![](/img/trans.png)
[英]jQuery - Get value of the next option in a dropdown after the selected one based on attribute
[英]jQuery - how can I get a value of the next option in a dropdown after the selected one?
我在index = 0處有一個選定選項的下拉列表。如何在jquery中獲取index = 1處的下一個選項的值? 當然,我需要在不指定下一個選項的值的情況下這樣做,因為我可以;假設此時將會是什么。
謝謝
你可以寫
$('#dropDownId option:selected').next().val()
要么
$('#dropDownId option:selected+option').val()
$('#selectid option:selected').next().val()
嘗試:
$('#selectId>option:selected').next().val()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.