function abc(str1,str2)
{
    window.alert(str1+str2);
}
str1,str2用文本框取值行吗?

解决方案 »

  1.   

    法一、function abc(str1,str2)
    {
        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>
      

  2.   

    <SCRIPT FOR = tr1 EVENT = onclick>
    abc('1','2')
    </script>
      

  3.   

    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.
      

  4.   

    <table><tr id='tr1'><td>ads</td></tr></table>
    <script>
    function abc(str1,str2)
    {
        window.alert(str1+str2);
    }
    tr1.onclick = function(){
    abc('111','333');
    }
    </script>