<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Test</title> <styletype= "Text/css"> </style> </Head> <Body> <Scripttype= "Text/javascript"> //prototype Way varWidgets= function() {title= "'; This. GetTitle=function(){ return This. title; } This. Settitle=function(){ This. Title=arguments[0]; } } varButton= function() {} Button.prototype= Newwidgets (); varEdit= function() {} Edit.prototype= Newwidgets (); varbtn= NewButton (); Btn.settitle ('Button Title name'); varEDT= NewEdit (); Edt.settitle ('Edit Title Name'); //Find prototype property when not found in current objectConsole.log (Edt.gettitle ()); Console.log (Btn.gettitle ()); Console.log (Btn.title+' '+edt.title);
//Call+prototype Way varToolbar= function() {Widget.call ( This); Toolbar.prototype= Newwidgets (); This. Settitle (arguments[0]); } varToolbar= NewToolbar ('Toolbar title name'); Console.log (Toolbar.gettitle ()+' '+toolbar.title); </Script></Body>