diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-04-04 11:45:14 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-04 18:30:15 +0200 |
commit | 2199a5961438ffd8706217363b34a9b45f100728 (patch) | |
tree | 02e910ce6a21d17b56846915b5a179bd2867ca87 /Base | |
parent | 0069020e6c40be02416f9ee4333fc752172113ea (diff) | |
download | serenity-2199a5961438ffd8706217363b34a9b45f100728.zip |
Base: Update radio button test page to mutate the DOM
Diffstat (limited to 'Base')
-rw-r--r-- | Base/res/html/misc/radio.html | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Base/res/html/misc/radio.html b/Base/res/html/misc/radio.html index a47cfdd7f6..5859ad87dc 100644 --- a/Base/res/html/misc/radio.html +++ b/Base/res/html/misc/radio.html @@ -30,12 +30,22 @@ <input type=radio id=targaryen name=got value=Targaryen> <label for=targaryen>Targaryen</label> + <br /> + <br /> + + <b>Selected</b> + <br /> + <div style="display: inline-block;"> + <pre>HP house: <span id=hp></span></pre> + <pre>GoT house: <span id=got></span></pre> + </div> + <script> const hp = document.getElementsByName('hp'); for (let i = 0; i < hp.length; ++i) { hp[i].addEventListener('change', function() { if (this.checked) { - console.log('HP house:', this.value); + document.getElementById('hp').innerHTML = this.value; } }); } @@ -44,7 +54,7 @@ for (let i = 0; i < got.length; ++i) { got[i].addEventListener('change', function() { if (this.checked) { - console.log('GoT house:', this.value); + document.getElementById('got').innerHTML = this.value; } }); } |