使用 prototype 库中的 bind 方法吧,将参数绑上去

解决方案 »

  1.   

    el.onclick=function(){ func("value") }
      

  2.   

    <input name="e1">
    <script language=javascript>
    var el=document.getElementById("e1")
    var value="haha"
    el.attachEvent("onclick", new Function("func('"+value+"')"));
    function func(str)
    {
    alert(str)
    }
    </script>
      

  3.   

    <PUBLIC:ATTACH EVENT="ondetach" ONEVENT="cleanup()" />
    <SCRIPT LANGUAGE="JScript">
    attachEvent ('onmouseover', Hilite);
    attachEvent ('onmouseout', Restore);
    function cleanup()
    {
    detachEvent ('onmouseover', Hilite);
    detachEvent ('onmouseout', Restore);
    }
    function Hilite()
    {
    if (event.srcElement == element)
    {
    normalColor = style.color;
    runtimeStyle.color  = "red";
    runtimeStyle.cursor = "hand";
    }
    }
    function Restore()
    {
    if (event.srcElement == element)
    {
    runtimeStyle.color  = normalColor;
    runtimeStyle.cursor = "";
    }
    }
    </SCRIPT>
      

  4.   

    谢谢mingxuan3000(铭轩)和jc15271149(没做过项目)了
    结帖!  送分了!
    yorkane()没写清楚,没去试.不好意思