测试代码

<script>
function test(form){
 var formName = form.getAttributeNode("name");  
 alert("called!");
 alert(form.name);
 alert(form.length);
 alert(form.getAttributeNode("name"));
 alert(form.getAttributeNode("name").value);
}
</script>

<body>
 <form name ="testForm" action ="" onClick = "test(this)">
 testtsetetesttest
 <input type = "text" name = "input1">
 <input type = "text" name = "input2">
 <input type = "hidden" name = "hidden1">
 </form>
</body>

你可能感兴趣的:(测试)