How to close a window using jQuery for all browser compatibility?
<input type="button" name="backButton" value="Close" style="background-color:#245f91; color:#fff;font-weight:bold;" onclick="window.close();">
This onclick
event is working in IE. Could you help me to write code in jQuery?
window. top. close(); this will close the current tab for you.
Simply call window. close() and it will close the current window.
Press Alt + F4 to close a window.
$(element).click(function(){ window.close(); });
Note: you can not close any window that you didn't opened with window.open
. Directly invoking window.close()
will ask user with a dialogue box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With