override constructor?

L

Lee Atkinson

Hi

I have a some code for creating a new object. What I would like to do
is to to have the new object base on an HTML element, created in the
constructor, e.g:

function Foo() {
//constructor code, including creating custom properties, etc, but
also be able to set properties on an html div element
}

....

var myFoo = new Foo();
alert(myFoo.innertHTML);


I could, of course, have a property of the object that references a
newly-created element, but I would rather have just one object.

Is this possible?

Regards

Lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top