1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

Base: Add test page for <input type=button> elements

Particularly to test label associations.
This commit is contained in:
Timothy Flynn 2021-04-04 12:16:31 -04:00 committed by Andreas Kling
parent e074fc70e1
commit d40f3aa0d0
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,21 @@
<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 />
<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>