jquery - getting those pesky dropdown values

Post

If you have coded javascript before, you will know that getting a selected option value from a dropdown is a couple tedious extra steps more than getting a value from a text field.

With jquery, no more will you need to treat these two fields differently.

If you need the value of a dropdown that has an id of "the_dropdown" you can write a quick jquery call to get it very easily: $('#the_dropdown').val()

That's it! It is just that simple.

Comments

Leave a comment

November 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Share