How to Go Back Page using Javascript


If You want to go on previous page on button click then following information will help you:

What you need to do is just write the code: 

javascript:window.history.back();

on OnClick event of HTML button.


<html>
<body>

<button onclick="javascript:window.history.back();">Go Back</button>

</body>
</html>

This is the same as clicking the "Back button" in your browser
The back() method loads the previous URL in the history list.

Almost all browsers support this code.







No comments:

Post a Comment

We are here to listen you, Comment your valueable opinion...!!!