Question: how to get the selected value of multiselect dropdown in javascript?
Answer: document. getElementById('submit'). onclick = function() { var select = document. getElementById('pets'); var selected = [... select. selectedOptions] . map(option => option. value); alert(selected); }