getElementsByTagName的用法
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language=javascript>
function ck()
{
var aa = document.getElementsByTagName("input");
var ss = "";
alert("网页里所有的input集合共有:"+aa.length+"个!");
for (var i=0; i<aa.length; i++){
if (aa .type=="text")ss=ss+aa.value+"■";
}
alert(ss);
ss.value="sss";
alert(ss.value);
var bb = ss.split("■") ;
bb.value="wewwew";
alert(bb);
alert(bb.length);
}
</script>
</HEAD>
<BODY>
<FORM name=form1 METHOD=POST ACTION="">
<INPUT TYPE="text" NAME=txt>
<INPUT TYPE="text" NAME=txt1>
<INPUT TYPE="text" NAME=txt2>
<INPUT TYPE="text" NAME=txt3>
<INPUT TYPE="text" NAME=txt4>
<INPUT TYPE=button οnclick="ck();">
</FORM>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language=javascript>
function ck()
{
var aa = document.getElementsByTagName("input");
var ss = "";
alert("网页里所有的input集合共有:"+aa.length+"个!");
for (var i=0; i<aa.length; i++){
if (aa .type=="text")ss=ss+aa.value+"■";
}
alert(ss);
ss.value="sss";
alert(ss.value);
var bb = ss.split("■") ;
bb.value="wewwew";
alert(bb);
alert(bb.length);
}
</script>
</HEAD>
<BODY>
<FORM name=form1 METHOD=POST ACTION="">
<INPUT TYPE="text" NAME=txt>
<INPUT TYPE="text" NAME=txt1>
<INPUT TYPE="text" NAME=txt2>
<INPUT TYPE="text" NAME=txt3>
<INPUT TYPE="text" NAME=txt4>
<INPUT TYPE=button οnclick="ck();">
</FORM>
</BODY>
</HTML>