如何用js让下拉菜单失效?
<selectid="Select1"disabled="disabled"><optionselected="Selected">1</option><option>2...
<select id="Select1" disabled="disabled">
<option selected="Selected">1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
设置disabled属性,用js如何设置? 展开
<option selected="Selected">1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
设置disabled属性,用js如何设置? 展开
1个回答
展开全部
<select id="Select1">
<option selected="Selected">1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<button onclick="disable();">disable</button>
<script type="text/javascript">
function disable(){
document.getElementById("Select1").disabled=true;
}
</script>
<option selected="Selected">1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<button onclick="disable();">disable</button>
<script type="text/javascript">
function disable(){
document.getElementById("Select1").disabled=true;
}
</script>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询