I have a drop down with a selected option at index = 0. How can I in jquery get the value of the next option at index = 1? Of开发者_Python百科 course I need to do that without specifying the value of the next option because I can;t assume what it will be at this point.
thx
You can write
$('#dropDownId option:selected').next().val()
Or
$('#dropDownId option:selected+option').val()
$('#selectid option:selected').next().val()
Try:
$('#selectId>option:selected').next().val()
精彩评论