请高人看看这两段代码,问什么init()不行,init1()可以
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type='text/javascript'>
function a(dom)
{
alert(dom.value);
}
function init()
{
var b = document.getElementsByTagName("input")
for (var i=0; i<b.length; i++)
{
b[i].onclick=function(){return a.apply(b[i],[b[i]])};
}
}
function init1()
{
var b = document.getElementById("btn")
b.onclick=function(){return a.apply(b,[b])};
}
</script>
</HEAD>
<BODY onload="init();">
<input type="button" id='btn' value="按钮">
</BODY>
</HTML>