<body>
<input name="tt_Span" type="button" value="1" /><br />
<input name="tt_Span" type="button" value="2" /><br />
<input name="tt_Span" type="button" value="3" /><br />
<input name="tt_Span" type="button" value="4" /><br /><SCRIPT LANGUAGE="JavaScript">
var col = document.getElementsByName( "tt_Span" );
for( var i = 0 ; i < col.length ; i++ )
{
col[i].attachEvent("onmouseover", new Function("ff('"+ i +"', 'black', '#eeeeee')"));
}function ff(i, a, b)
{
alert(col[i].value);
}
</SCRIPT>
<input name="tt_Span" type="button" value="1" /><br />
<input name="tt_Span" type="button" value="2" /><br />
<input name="tt_Span" type="button" value="3" /><br />
<input name="tt_Span" type="button" value="4" /><br /><SCRIPT LANGUAGE="JavaScript">
var col = document.getElementsByName( "tt_Span" );
for( var i = 0 ; i < col.length ; i++ )
{
col[i].attachEvent("onmouseover", new Function("ff('"+ i +"', 'black', '#eeeeee')"));
}function ff(i, a, b)
{
alert(col[i].value);
}
</SCRIPT>
col[i].attachEvent("onmouseover", new Function("ff('"+ i +"', 'black', '#eeeeee')"));
和
col[i].attachEvent( "onmouseover", function () { ff(i, 'black', '#eeeeee'); } );