使用jQuery将.html() of a <option>在<select> (之前我已将selectedIndex属性设置为-1)中将<select>的selectedIndex属性从“-1”重置为“0”
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<select id="myselect" class="drpmnu">
<option id="one" >(01)</option>
<option id="two" >(02)</option>
<option id="three" >(03)</option>
</select>
<script>
$(".drpmnu").prop('selectedIndex', -1)
$('#three').html("moo")
</script>
</body>
</html>http://jsbin.com/filowe/2/edit?html,output
https://stackoverflow.com/questions/28209320
复制相似问题