Does anyone know if you can access/add to the prototype for an elements constructor with javascript? The idea is I would like to add default functionality to certain elements (specifically "Label" elements). The company that this project is for has all of their forms in flat html files that I load with ajax and add to object groups for easier manipulation, it would be really helpful if I could add the methods necessary when the html elements are loaded on the page.
Right now I just load all the elements currently loaded on the page into an object and iterate through them, applying methods depending on the tagName. It works fine, but after a few forms have been loaded the page obviously slows down. I know how to add to the constructor's prototype of other javascript objects, and I know the constructor for a label element is referenced with "HTMLLabelEleme nt", but I can't seem to affect the prototype...any thought would be appreciated:)
Right now I just load all the elements currently loaded on the page into an object and iterate through them, applying methods depending on the tagName. It works fine, but after a few forms have been loaded the page obviously slows down. I know how to add to the constructor's prototype of other javascript objects, and I know the constructor for a label element is referenced with "HTMLLabelEleme nt", but I can't seem to affect the prototype...any thought would be appreciated:)
Comment