用js 来设置默认值 10
<selectmaxlength="20"id="select1"name="LIMIT_IFRECORDDSGHEARTDAILY"class="inputstyle"...
<select maxlength="20" id="select1" name="LIMIT_IFRECORDDSGHEARTDAILY" class="inputstyle">
<option value="">请选择</option>
<logic:equal value="0" name="deviceForm" property="LIMIT_IFRECORDDSGHEARTDAILY">
<option value="0" selected>不存储</option>
<option value="1">存储</option>
</logic:equal>
<logic:equal value="1" name="deviceForm" property="LIMIT_IFRECORDDSGHEARTDAILY">
<option value="0">不存储</option>
<option value="1" selected>存储</option>
</logic:equal>
</select>
怎样 用js 来设置默认值 展开
<option value="">请选择</option>
<logic:equal value="0" name="deviceForm" property="LIMIT_IFRECORDDSGHEARTDAILY">
<option value="0" selected>不存储</option>
<option value="1">存储</option>
</logic:equal>
<logic:equal value="1" name="deviceForm" property="LIMIT_IFRECORDDSGHEARTDAILY">
<option value="0">不存储</option>
<option value="1" selected>存储</option>
</logic:equal>
</select>
怎样 用js 来设置默认值 展开
1个回答
展开全部
<body>
<select>
<option name="sele">1</option>
<option name="sele">2</option>
<option name="sele">3</option>
<option name="sele">4</option>
</select>
<script>
//为要设置默认的元素添加selected的属性
document.getElementsByName('sele')[2].setAttribute('selected','');
</script>
</body>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询