Skip to content

Commit

Permalink
Base: Add test page for <input type=button> elements
Browse files Browse the repository at this point in the history
Particularly to test label associations.
  • Loading branch information
trflynn89 authored and awesomekling committed Apr 4, 2021
1 parent e074fc7 commit d40f3aa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Base/res/html/misc/button.html
Original file line number Diff line number Diff line change
@@ -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>
1 change: 1 addition & 0 deletions Base/res/html/misc/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ <h1>Welcome to the Serenity Browser!</h1>
<li><a href="float-3.html">floating boxes with overflow=hidden</a></li>
<li><a href="padding-inline.html">inline elements with padding</a></li>
<li><a href="event-bubbling-and-multiple-listeners.html">event bubbling and multiple listeners</a></li>
<li><a href="button.html">button</a></li>
<li><a href="radio.html">radio button</a></li>
<li><a href="checkbox.html">checkbox</a></li>
<li><a href="canvas-rotate.html">canvas rotate()</a></li>
Expand Down

0 comments on commit d40f3aa

Please sign in to comment.