我正在尝试将下拉列表的索引设置为 0;如果用户取消选中示例中所示的复选框,但有些人只是忽略了......
$ddlHeader.attr('selectedIndex', 0);
http://jsfiddle.net/abuhamzah/9YM4P/
//html:
Header:
<br /><input id="check" type="checkbox" name="approve" />
<select id="myddl" name="myddl">
<option value="0">select me</option>
<option value="1">One</option>
<option value="2">Twooo</option>
<option value="3">Three</option>
</select>
</p>
//js
var $ddls = $('select');
var $check = $('#check');
var $ddlHeader = $("#myddl");
$ddls.prop("disabled", true);
$check .click(function() {
$ddls.prop("disabled", true);
$ddlHeader.prop("disabled", !this.checked);
$ddlHeader.attr('selectedIndex', 0);
});