function ge(id){
this.id=id;
this.d=document;
this.w=window;
return document.getElementById(id);
}
ge.prototype={
set_in:function(value){
this.innerHTML=value;
},
getIn:function(){
return document.getElementById(this.id).innerHTML;
},
foc:function(){
document.getElementById(this.id).focus();
}
}
i want to do is that if i call ge(‘id’).getIn() will result in innerHTML of that element
You need to call
new ge("header").getIn();instead of justge("header").getIn();– Or create another function that returns a new instance ofge– For ex: