0
prototype is a function of a object or node Node.prototype.nameOfFunction = function() { alert(this.value); } document.getElementsByTagName("input")[0].nameOfFunction(); // to use this prototypeyou must get a input and use a method nameOfFunction. this code return value of input var obj = { age : 30 } obj.prototype.nameoffunction = function() { alert(this.age); } obj.nameoffunction();//use a method nameoffunction and It return obj.age ( 30 )
10th Jul 2016, 9:28 AM
Daniel
Daniel - avatar