Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Close Tab With Javascript.
#1
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:

Quote:<script language="JavaScript">


function closeIt() {
close();
}


</script>

<center>
<form>
<input type=button value="Your Text" onClick="closeIt()">
</form>
</center>

Thanks for reading. Oui
Reply


Messages In This Thread
Close Tab With Javascript. - by Qua - 06-27-2011, 08:43 PM
RE: Close Tab With Javascript. - by Dr.BrokenGod - 06-29-2011, 03:38 PM
RE: Close Tab With Javascript. - by Injection - 07-01-2011, 03:47 PM
RE: Close Tab With Javascript. - by djakariuz - 07-02-2011, 07:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Free Worker HTML, CSS, Javascript ImFocuzz 2 1,286 04-05-2014, 10:01 PM
Last Post: VHPanda
  [MyBBError Message] PLEASE HELP ME!! Enable Javascript Registration Error iRun 4 1,931 01-26-2012, 03:13 PM
Last Post: iRun
  Tab system now working? Rуan 5 1,466 01-14-2012, 03:57 AM
Last Post: Techie.
  Keyboard shortcuts with JavaScript rockclimber66 12 3,127 05-07-2011, 01:21 AM
Last Post: Danny
  Javascript Help. Form Submission. JohnRonder 0 891 02-01-2011, 11:12 AM
Last Post: JohnRonder

Forum Jump:


Users browsing this thread: 1 Guest(s)