How can I get the selected value of a dropdown box using jQuery?
I tried using
var value = $('#dropDownId').val();
and
var value = $('select#dropDownId option:selected').val();
but both return an empty string.
How can I get the selected value of a dropdown box using jQuery?
I tried using
var value = $('#dropDownId').val();
and
var value = $('select#dropDownId option:selected').val();
but both return an empty string.
Yet another tested example:
I know this is old but I though I update this with an more up to date answer
I hope this helps
Try this, it gets the value:
$('select#myField').find('option:selected').val();
Try this:
Or if you would try :
I used It today and It working fine.