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
#2
The rep idea is really great. I will try that one!
Reply
#3
thanks! I like them alot..
added to my site
Reply
#4
Yeah it's a good idea xD, helps a lot. This is what they use for rep thing too.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Free Worker HTML, CSS, Javascript ImFocuzz 2 1,284 04-05-2014, 10:01 PM
Last Post: VHPanda
  [MyBBError Message] PLEASE HELP ME!! Enable Javascript Registration Error iRun 4 1,923 01-26-2012, 03:13 PM
Last Post: iRun
  Tab system now working? Rуan 5 1,460 01-14-2012, 03:57 AM
Last Post: Techie.
  Keyboard shortcuts with JavaScript rockclimber66 12 3,122 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)