87,843
社区成员




<select id=“targetType”>
<option name=targetType class="default" value="5">无操作</option>
<option name=targetType value="1">我是1</option>
<option name=targetType value="2">我是2</option>
<option name=targetType value="3">我是3</option>
<option name=targetType value="4">我是4</option>
<input type="button" value="初始化" id="reset-button">
$("#reset-button").click(function() {
$("#targetType").val( $("#targetType").find(".default").attr("value") );
});
<select id="targetType">
<option name=targetType value="5">无操作</option>
<option name=targetType value="1">我是1</option>
<option name=targetType value="2">我是2</option>
<option name=targetType value="3">我是3</option>
<option name=targetType value="4">我是4</option>
</select>
<input type="button" value="初始化" id="reset-button">
<script type="text/javascript">
document.getElementById("reset-button").onclick = function ()
{
document.getElementById("targetType").selectedIndex = 0;
}
</script>
<input type="button" value="初始化" id="reset-button" onclick="document.getElementById('targetType').options[0].selected='selected'">