JS遍历问题

dming4 2008-06-11 09:57:03
<div id="region1" style="border:1px solid green;margin-top:10px;height:200px;">
<br />
服务器控件: 
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
<br />
客户端控件: 
<input id="Text2" type="text" /><br />
<br />
服务器按钮<asp:Button ID="Button3" runat="server" Text="Button" /><br />
<br />
客户端按钮<input id="Button4" type="button" value="button" />
<input id="Submit2" type="submit" value="submit" />
</div>


遍历region1下面每个元素,设置disabled=disabled
...全文
44 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
s_liangchao1s 2008-06-11
  • 打赏
  • 举报
回复

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href=" <%=basePath%>">

<title>My JSP 'index.jsp' starting page </title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
window.onload = function(){
var oCon = document.getElementById('region1').getElementsByTagName("*");
for(var i=0;i<oCon.length;i++){
oCon[i].disabled = true;
}
}


</script>
</head>

<body>
<div id="region1" style="border:1px solid green;margin-top:10px;height:200px;">
<br />
服务器控件: 
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
<br />
客户端控件: 
<input id="Text2" type="text" /><br />
<br />
服务器按钮<asp:Button ID="Button3" runat="server" Text="Button" /><br />
<br />
客户端按钮<input id="Button4" type="button" value="button" />
<input id="Submit2" type="submit" value="submit" />
</div>
</body>
</html>



87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧