What's the JS code for closing a window....?
Well, I am maintaining a website, and I need some help...
What is the JS code for closing a window?
As in, at the top of the page there will be a link "Close Window". and when you click... it closes the window..
Can anyone help me out here?
Thanks,
Rafi
Re: What's the JS code for closing a window....?
<form method="post">
<input type="button" value="Close Window"
onclick="window.close()">
</form>
(does not work in Firefox)
Re: What's the JS code for closing a window....?
Thanks :)
Could you also please tell me what the code is for going back (as in like clicking on the back button in the browser, but a button that says "Back" on it..)
Thanks a lot!! :D
Re: What's the JS code for closing a window....?
I just use this link for that:
Code:
<a href="javascript:history.go(-1)">
There's probably a better way of doing it tho. :unsure:
Re: What's the JS code for closing a window....?
<form>
<input type="button" VALUE="Go back" onClick="history.go(-1)">
</form>