Quick question, I recently looked up how to retrieve the selected value of a drop down list, I found an answer but it uses syntax I am not familiar with, I was hoping someone could enlighten me as to how this works.
The solution offered was something like this:
var description = document.querySelector(".add__description");
description.options[description.selectedIndex].value
Why does the above work, but the following code:
description.options.selectedIndex.value
Does not?
Thanks in advance.