87,921
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script >
function funClear(){
var txts=document.getElementsByTagName("input");
for(var i=0;i<txts.length;i++)
{
if(txts[i].type=="text")
{
txts[i].value ="";
}
}
}
</script>
</HEAD>
<BODY>
<form>
<input name="txt1" type="text" value="" /><Br>
<input name="txt2" type="text" value="" /><Br>
<input name="txt3" type="text" value="" /><Br>
<input name="txt4" type="text" value="" /><Br>
<input type="button" value="清空" onclick="funClear()"/>
</form>
</BODY>
</HTML>