Hi all! I'm pretty new to JavaScript and completely new to this forum. I'm James.
Well uh, I'm not sure how to...
I wanted to make something like this using javascript...
Code:
myObject.someMethod('something').anotherProperty
much like the
Code:
document.getElementById('someId').style.morestuff
But the thing is, I've been around every DOM whatnot I can find, I just can't seem to make it work.
I kinda need it to make my own DOM for some API i'm writing. So I can write like...
Code:
function someGreatAPI(){
this.property1='';
this.property2='';
//...
this.method1 = function(var1){ //this should make my firstMethod
this.nestedProperty = 0;
this.nestedMethod = someFunction; //firstMethods nested method
}
}
//so I can use it like...
var obj = new someGreatAPI();
obj.method1(10).nestedMethod();
It has to be possible, it's possible with document.getelementbyid, right? it has to be.
Thanks in advance.