disabling back button using javascript

By default browsers does not allow us to disable back button. However, when working with database applications, we often need to disable the back button. In this example, we disable the back button using javascript:

<html>
<head></head>
<body>
<h1>This is page 1</h1>
<br><br>
<input id="btnback" name="btnback" type="button" value="Back" onclick="window.history.back();" />
</body>
</html>

 

Add a Comment

Your email address will not be published. Required fields are marked *