document.all['aaaaa'].popup('cccc');
这下明白了吧

解决方案 »

  1.   

    这样写试试把
    protected override void AddAttributesToRender(HtmlTextWriter writer)
    {
       writer.AddAttribute("popup", "var func = function(value){alert(value);}");
    }eval($('aaaaa').popup);
    func('test');
      

  2.   

    var $=function(id){
    return document.getElementById(id);
    }
      

  3.   

    prototype.js 应用于学习还是8错的
      

  4.   

    babyrockxray(紫色阴影) : 你这种方式不符合面向对象的。Input有一个select()方法,是把里面的文本选中,我就想给控件增加这样一种方法。
      

  5.   

    给控件不能这么加的<html>
    <body>
    <div id="id1"></div>
    <script>
    Function.prototype.Bind=function(f)
    {
       _this=this;
       return function(){
          return f.apply(null);
       }
    }
    var obj1=document.createElement("input");
    obj1.type="text";
    f1=function(){}
    f2=function(){alert('123');}
    obj1.onclick=f1.Bind(f2);
    document.getElementById("id1").appendChild(obj1);</script>
    </body>
    </html>
      

  6.   

    Function.prototype.Bind=function(f)
    {
       _this=this;
       return function(){
          return f.apply(null);
       }
    }写得有点儿不太好,不过好象这个也是prototype.js的方法,lz可以看看源码
      

  7.   

    babyrockxray(紫色阴影) : 你这种方式不符合面向对象的。Input有一个select()方法,是把里面的文本选中,我就想给控件增加这样一种方法。==========
    那你就不能这么加,得在js里面定义一下
    $('aaaaa').popup = function(value){alert(value);}$('aaaaa').popup('cccc');