如果获取所有TextBox? o = document.getElemnetsByTagName("INPUT")for(i=0;i<o.length;i++){if(o[i].type=="textbox") alert(o[i].value)} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head> <script language="javascript"> function CheckEmpty() { var oText=window.Form2.getElementsByTagName("input"); alert(oText.length); for(var i=0;i<oText.length;i++) { if(oText[i].type=="text" && oText[i].value=="") { alert(oText[i].name); } } } </script></head> <body> <form id="Form2"> <input type="text" name="f1" id="f1"> <input type="text" name="f2" id="f2"> <input type="text" name="f2" id="f3"> <input type="button" id="button1" value="go" onclick="CheckEmpty();"> </form> </body></html> o = document.getElementsByTagName("INPUT")for(i=0;i<o.length;i++){if(o[i].type=="textbox") alert(o[i].value)} for(var i=0;i<document.all.length;i++){ if(document.all(i).type=='text') alert(document.all(i).value);} javascript修改另一页面的内容 帮忙写个正则式 如何在加了鼠标事件后,取到最新的代码 javascript访问ActiveX属性 动态交互图形系统开发技术 一个三级菜单的问题...问了很多人都没有结果 请帮个忙~ 父窗口向子窗口取值的问题,希望大家讨论 document.all在netscape中有没有相应的语句? 如何用js代码禁止浏览器弹出打印预览页面直接使用系统对话框打印 怎样在javascript中直接设置好打印方式为横向或纵向 和Radio有关的提交表单的问题 ,选中一个单选按钮Radio,怎样才能在提交表单时只提交点选了Radio的后面的内容
<head>
<script language="javascript">
function CheckEmpty()
{
var oText=window.Form2.getElementsByTagName("input");
alert(oText.length);
for(var i=0;i<oText.length;i++)
{
if(oText[i].type=="text" && oText[i].value=="")
{
alert(oText[i].name);
}
}
}
</script></head>
<body>
<form id="Form2"> <input type="text" name="f1" id="f1">
<input type="text" name="f2" id="f2">
<input type="text" name="f2" id="f3">
<input type="button" id="button1" value="go" onclick="CheckEmpty();">
</form>
</body>
</html>
for(i=0;i<o.length;i++)
{
if(o[i].type=="textbox") alert(o[i].value)
}
{
if(document.all(i).type=='text') alert(document.all(i).value);
}