Newer
Older
minerva / Base / res / html / misc / button.html
@minerva minerva on 13 Jul 847 bytes Initial commit
<body>
    <br />
    <input type=button id=button1 name=hp value="Option 1">
    <label for=button1>Press Me!</label>
    <br />
    <input type=button id=button2 name=hp value="Option 2">
    <label for=button2>No, Press Me!</label>
    <br />
    <input type=button id=button3 name=hp value="Option 3" disabled>
    <label for=button3>You'll never get this!</label>
    <br />
    <div style="display: inline-block;">
        <pre>Last pressed: <span id=last></span></pre>
    </div>

    <script>
        document.getElementById('button1').addEventListener('click', function() {
            document.getElementById('last').innerHTML = this.value;
        });
        document.getElementById('button2').addEventListener('click', function() {
            document.getElementById('last').innerHTML = this.value;
        });
    </script>
</body>