Here is a demo code snippet, copy-paste into a plain text file with .htm extension and open into browser. Click on the button and it should open www.itfunda.com in a new window
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function OpenNewPage() {
window.open('http://www.itfunda.com', "", "");
}
</script>
</head>
<body>
<input type="button" name="btn" id="btn" value="Click to open page in new tab" onclick="OpenNewPage()" />
</body>
</html>
Here we have a button, on click of the button we are calling
OpenNewPage javascript function. In that function, we are using the window.open method by passing the url to open the web page.
More details on window.open are at
http://www.dotnetfunda.com/codes/code84-how-to-open-a-new-window-in-javascript-.aspx .
Hope this helps.
Thanks
Regards,
Sheo Narayan
http://www.dotnetfunda.com
Kapsystem, if this helps please login to Mark As Answer. | Alert Moderator