Apu
September 13, 2022 .
#Attribute
.
#HowTo
❌
How to get dropdown selected value in jQuery by class
In this article, you will learn how to get selected value of dropdown in jQuery by class attribute.
Demo : get selected value of dropdown using class.
<select class="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 dropdown selected value in jQuery by class
0
In this article, you will learn how to get selected value of dropdown in jQuery by class …
asked
Apu
0 answers
2915
In this article, you will learn how to get selected value of dropdown in jQuery by class …
Answer Link
answered
Apu