A Javascript Program To make (open new window and close that window) button in your web browser.

A Javascript Program To make (open new window and close that window) button in your web browser.


<html>
<head>
<script>
function openWin()
{
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>This is 'myWindow'</p>");
}

function closeWin()
{
myWindow.close();
}
</script>
</head>
<body>

<input type="button" value="Open 'myWindow'" onclick="openWin()" />
<input type="button" value="Close 'myWindow'" onclick="closeWin()" />

</body>
</html>
 
 

Comments

Popular posts from this blog

A simple running clock in javascript