定义一个继承自div的对象
function Node()
{
}
如果使得Node继承自div对象
[解决办法]
function Node(html){
var el=document.createElement('Div');
for(var k in this) el[k]=this[k];
el.innerHTML=html;
return el;
}
Node.prototype.hide=function(){ //添加隐藏方法
this.style.display="none"
}
var node=new Node( 'ok' ) //实例 并且 HTML = ok
document.body.appendChild( node );
setTimeout( function(){
node.hide(); //隐藏
},1500 )