这是一个例子,
<select>
<option value=1>Cars</option>
</select>
我如何获得选定“1”的值和列表框“汽车”中的值?
试试这个
<select id="selectID">
<option value=1>Cars</option>
</select>
使用 javascript
var e = document.getElementById("selectID");
var strUser = e.options[e.selectedIndex].value;
jQuery("#sltbox").find("option[value=1]").attr("selected","selected")
将 id 作为 sltbox 提供给您的选择标签。