Tab.Content = function (f)
{
alert(f);//加上单引号
}

解决方案 »

  1.   

    obj.getElementsByTagName("Table");得到的是一个nodelist,在js中是一个对象。
    那么你或许可以这样写
    Object.prototype.Content = function ()
    {
        //
    }但是还是改HTMLElement的原型比较合理
    HTMLElement.prototype.Content = function ()
    {
        //
    }
    Element.prototype.Content = function ()
    {
        //
    }
      

  2.   

    直接在Object的原型上加方法
    Object.prototype.Content=function(){.....}
      

  3.   

    Object.prototype.Content=function(){.....}这样不行。。 无法执行。。