Today, we will explain how to disable the browser back button using jquery. if you want to disable your browser back button you can use window.history.pushState to get jquery


#example.html

<!DOCTYPE html>
<html>
    <head>
        <title>PHP & jquery tutorial</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    </head>
    <body>
        <h1>Click the browser back button</h1>
    </body>
    <script type="text/javascript">
        $(document).ready(function() {
            window.history.pushState(null, "", window.location.href);
            window.onpopstate = function() {
                window.history.pushState(null, "", window.location.href);
            };
        });
    </script>  
</html>