I have a selector with only emojis as options, and when trying to get the value in JS (the emoji the user picked) the console is printing it as an empty string.
This is my HTML code for the selector:
<select id="iconSelector">
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
<option value=""></option>
</select>
And this is my JS code for getting the value:
const addTaskBtn = document.querySelector("#newTaskBtn");
addTaskBtn.addEventListener('click', () => {
let taskName = document.querySelector('#taskInput').value;
let taskIcon = document.querySelector('#iconSelector').value;
console.log(taskName);
console.log(taskIcon); // Getting <empty string> in console.log
document.querySelector('#taskInput').value = '';
})