Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addItem() {
- console.log('TODO:...');
- const itemText = document.getElementById('newItemText').value;
- const itemValue = document.getElementById('newItemValue').value;
- let newOption = document.createElement('option');
- newOption.text = itemText;
- newOption.value = itemValue;
- const selectMenu = document.getElementById('menu');
- selectMenu.appendChild(newOption);
- document.getElementById('newItemText').value = '';
- document.getElementById('newItemValue').value = '';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement