06-27-2011, 08:43 PM
Here's a simple Javascript code that will display a button, and once clicked it will activate the closeIt function which will close a tab.
If the tab with the button is the only tab you're on it closes your browser.
A good use for this could be for something like when you give rep, it says close window.
Here's the code:
Thanks for reading.
If the tab with the button is the only tab you're on it closes your browser.
A good use for this could be for something like when you give rep, it says close window.
Here's the code:
Quote:<script language="JavaScript">
function closeIt() {
close();
}
</script>
<center>
<form>
<input type=button value="Your Text" onClick="closeIt()">
</form>
</center>
Thanks for reading.