Window.Close() method is used for close
window using JavaScript in HTML
Example :
<input type="button" value="Close" class="button" onclick="window.opener=null; window.close(); return
false;">
HTML Example For Open Window and Close
Window on Button Click Event:
Example :
<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>
Window.Close() method is used for close window using
JavaScript in ASP.NET.
Example :
<asp:Button ID="Button2"
runat="server" Text="Close" OnClientClick="javascript:
window.close();"/>
No comments:
Post a Comment