<SCRIPT FOR = tr1 EVENT = onclick> abc('1','2') </script>
Code within the SCRIPT block that is not contained within a function is executed immediately as the page is loaded. To keep scripts from being displayed on down-level browsers, nest the SCRIPT block within a COMMENT block.
{
window.alert(str1+str2);
}
function trclick()
{
abc('1','2');
}
tr1.onclick=trclick;法二、tr1.onclick=new function{abc('1','2');};
法三、<table><tr id='tr1' onclick="abc('1','2');"><td>ads</td></tr></table>
abc('1','2')
</script>
<script>
function abc(str1,str2)
{
window.alert(str1+str2);
}
tr1.onclick = function(){
abc('111','333');
}
</script>