<form name="form1" method="post">
<input type=text name="i1" onblur="document.all.button1.click()" value="">
<input type=text name="i2" value="">
<input name=button1 type=button value="ok" onclick="alert('btn');">
</form>
<input type=text name="i1" onblur="document.all.button1.click()" value="">
<input type=text name="i2" value="">
<input name=button1 type=button value="ok" onclick="alert('btn');">
</form>
刚才进行了一下测试,如果不是alert还是可以的。
---------
一次配对的mousedown+mouseup才是一次click,
当onblur里有alert时,
button上只有mousedown,无法有配对的mouseup,
所以click事件不会被触发。将button的onclick改成onmousedown会有你所希望的效果。<form name="form1" method="post">
<input type=text name="i1" onblur="alert('blur');" value="">
<input type=text name="i2" value="">
<input type=button value="ok" onmousedown="alert('btn');">
</form>
如果是onmousedown的话,会出现两次blur的alert中间出现一次btn