一个JS循环控制input值的问题 本帖最后由 hkstb 于 2009-09-03 10:15:14 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><body><%For I=0 To 10Response.Write "<input name='hk"&I&"' id='hk"&I&"' type=text value='"&I&"' /><br />"Next%><script language="javascript"> for (JsZI = 1; JsZI < <%=I%>; JsZI++) { if (document.getElementById("hk"+JsZI).value == 5) document.getElementById("hk"+JsZI).value = 222; }</script></body></html> 如何打开服务器上的文件 强大的onpropertychange 求浏览器的兼容方案 js 日期转换 虚心请教:如何实现这样的功能? JS中,数值转字符串用什么函数 我写的验证时间的函数,有什么错误啊?为什么不好用? js和jsp之间能传递参数吗? 怎样编写mediaplay的进度条?? nodejs怎么在页面跳转的时候,浏览器地址不跳转 如何用js获取表格中某一格的值 jquery+js如何删除div下重复的代码串,只保留1条,并总结共多少条? checkbox的onclick事件无法触发
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<%
For I=0 To 10
Response.Write "<input name='hk"&I&"' id='hk"&I&"' type=text value='"&I&"' /><br />"
Next
%>
<script language="javascript">
for (JsZI = 1; JsZI < <%=I%>; JsZI++) {
if (document.getElementById("hk"+JsZI).value == 5)
document.getElementById("hk"+JsZI).value = 222;
}
</script>
</body>
</html>