Apu
September 13, 2022 .
#Attribute
.
#HowTo
❌
How to get selected value of dropdown in jQuery by id
In this article, you will learn how to get selected value of dropdown in jQuery by id attribute.
Demo : get selected value of dropdown using id.
<select id="my-element">
<option>Drop down 1</option>
<option>Drop down 2</option>
<option>Drop down 3</option>
<option>Drop down 4</option>
</select>
<script>
$("#my-element").change(function(){
let myValue = $(this).val();
alert(myValue);
})
</script>
Try it Yourself »
save
listen
AI Answer
How to get selected value of dropdown in jQuery by id
0
In this article, you will learn how to get selected value of dropdown in jQuery by id att…
asked
Apu
0 answers
2915
In this article, you will learn how to get selected value of dropdown in jQuery by id att…
Answer Link
answered
Apu