H I O X INDIA
Javascript Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java-Script Tutorial
Introduction
Variables
Operators
Statements
Loops
Functions
Objects
Arrays
Browser Objects
Form DOM
Ask Your Doubts
Feedback





History - Go Previous Page


Topic

Back function to go to previous web page



Explanation

Methods or Function: back()
        back() function is used to go back to the previous web page in the history list. This does the same function as of back button in the browser window.

Code: history.back();

Example: To create a back button that takes to the previous page when users click on it.
Code:
<script language="javascript">
function goback(){
history.back();
}
</script>
<input type=button value="go back" onClick=goback()>

Result:
In the above example
a) we created a button
b) added an onClick event listener to the button.
c) when user click on the button the javascript function goback() will be invoked.
d) in that function we call history.back().




        Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

others

privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Other Links