Tricky ain’t it! To repeat:
JQuery’s main goal is to provide a developer with an easy way to handle DCOM objects with CSS and XPath selectors. It is not in any way a replacement for JS. You can look at it as a JS library.
Jim, it really depends on your understanding what is jQuery or even other frameworks. What i have understood about jQuery so far is:
So it can be explained in this way, instead of reinventing the wheel, it is better to use an existing and well tested working wheel
So it all comes down to whether you want to use a general all-purpose extremely heavy wheel or to make your own much lighter wheel that is more specific to the vehicle you want to use it on.
if you’re wanting firstchild.value you could use this instead:
That is, if the form field you’re getting the value from is an input element.
To my knowledge, jQuery doesn’t provide any helpers to assist with that, though you can go to http://docs.jquery.com/Main_Page and have a quick look through the API Reference.
Would the .val($(x[index]).html()); be innerhtml or firstchild.nodevalue?
Though my example uses innerhtml, I actually use firstchild.nodevalue.
And does jquery have a self.close();
like in my example?
The syntactic shortcuts and various functions are also very very nice, but in my opinion, the real gem is that the library is like a huge compatibility layer that’s been very heavily battle tested.
Which raises the question do you have to be as smart as the person who wrote jQuery. I can move my mouse in windows, but I have no idea how that’s implemented. Does that make me not as smart as the person who wrote that? Should I care?
In the thread Why web standards can cripple the web there’s a whole discussion on this very same topic. Might want to check it out.