Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
666 B
1
Indexable
Never
<!DOCTYPE html>
<html>
<head>
    <title>History Class Demo</title>
</head>
<body>
    <h1>History Class Demo</h1>
    <p>Click the buttons to navigate through the history:</p>

    <button id="backButton">Back</button>
    <button id="forwardButton">Forward</button>

    <script>
        // Function to go back in history
        document.getElementById("backButton").addEventListener("click", function() {
            window.history.back();
        });

        // Function to go forward in history
        document.getElementById("forwardButton").addEventListener("click", function() {
            window.history.forward();
        });
    </script>
</body>
</ht