How should I define whats going on here from left to right. I’m perplexed with the [0].nameofsomething part. Stupid quesiton for bonus, can the [0] be any other integer too? It looks like the jquery selector is now namespaced..is that correct?
$("#someselector")[0].nameofsomething = new MyObject();
and could this also be written like this….
$("#someselector").nameofsomething = new MyObject();
and produce exactly the same results?
thanks for any insight!
The [0] selects the DOM object, so you are adding to the element.
You are adding to the jQuery object
So they are not the same thing.