Created
December 14, 2018 10:51
-
-
Save alicethewhale/a109ec11d8980fdbb446a85447269ab9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="controls"> | |
<select name="toppers"> | |
<option value="⭐">⭐</option> | |
<option value="👼">👼</option> | |
</select> | |
</div> | |
... | |
<script> | |
const topSelector = document.querySelector('select'); | |
const topper = document.querySelector('.topper'); | |
function handleChange() { | |
topper.textContent = topSelector.value; | |
} | |
topSelector.addEventListener('change', handleChange); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment