Select option value | Sololearn: Learn to code for FREE!

+3

Select option value

I create a test and I can’t get the value of selected item in <select><option> how can I do this? I tried a lot of codes...

3/10/2019 12:02:38 PM

Sonia Golubkova

3 Answers

New Answer

+3

var sel = document.getElementById("sel"); // select element var selected = sel.options[sel.selectedIndex].value; https://code.sololearn.com/WT8wFn67dAwV/?ref=app

+2

its actualy worked! thank you!!

+2

Can you help an amateur