Assuming I have a div
that looks like:
<div id="testDiv">some stuff in here</div>
and I have a script that defines an object literal:
var testObject =
{
testDiv: $("#testDiv"),
testDivProperty: this.testDiv
};
Why is it when I access testObject.testDiv
I get a reference to a jQuery object, i.e.,
[<div id="testDiv">…</div>]
but when I access testObject.testDivProperty
I get a reference to the actual element, i.e.,
<div id="testDiv">…</div>
and hence am not able to perform jQuery operations on testObject.testDivProperty
?