In a db, I have a table that has the following columns.
I have one or many links using javascript how can I open each of the links in a different tab
example: www.google.com; www.yahoo.com
Hi Donny17,
Check this example.
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function OpenTabs() { var urls = document.getElementById('txtUrl').value; for (var i = 0; i < urls.split(';').length; i++) { window.open(urls.split(';')[i], '_blank'); } } </script> </head> <body> <form id="form1" runat="server"> <div> <input id="txtUrl" type="text" value="http://www.aspforums.net/; https://www.aspsnippets.com/" /> <input type="submit" value="Open" onclick="OpenTabs(); return false;" /> </div> </form> </body> </html>
Demo
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.