<head>
<script language="javascript">
function hanshu_1()
{
alert("测试中")
}
</script>
</head><body>
<form id="form1" name="form1" method="post" action="study_04_root.asp">
  <p>a
  <label for="txta"></label>
  <input onblur="hanshu_1()" type="text" name="txta" id="txta" />
  b
  <label for="txtb"></label>
  <input type="text" name="txtb" id="txtb" />
  c
  <label for="txtc"></label>
  <input type="text" name="txtc" id="txtc" />
  </p>
  <p>
    <input onclick="hanshu_1()" type="submit" name="button1" id="button1" value="提交" />
    <input type="reset" name="button2" id="button2" value="重置" />
  </p>
</form></body>
</html>点用户点击"提交"时
究竟是先执行action="study_04_root.asp",还是先执行onclick="hanshu_1()"书中说:点击时,会执行form.action
书中又说:有onclick时,会调用相应的函数.现这二个事情,碰一块了.
究竟先执行哪个呢?我测试的结论是:先执行函数hanshu_1(),后执行action里面的.
为什么呢?