Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
Add Comment
Please, Sign In to add comment