Answer the question
In order to leave comments, you need to log in
How to know what is selected in "select" JS?
Hello,
My django generates the following code:
<select name="docorderproduct_set-0-pack" id="id_docorderproduct_set-0-pack">
<option value="" selected>---------</option>
<option value="1">Мигдаль 1 кг </option>
</select>
pack = document.getElementById("id_docorderproduct_set-0-pack").selectedOptions[0].value
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question