document.anchors as jQuery argument
in the docs its mentioned that you can pass DOM elements in the jQuery function like this
jQuery(document) etc
i was trying to recreate this example http://www.w3schools.com/jsref/coll_doc_anchors.asp
with a line of code similar to this
jQuery(document.anchors[0]).addClass('checkIfIsAdded');
which doesn't seem to work
jQuery(document.anchors).addClass('checkIfIsAdded');
is not working
of course for achieving the same effect i could use
jQuery('a').addClass('checkIfIsAdded');
but i am wondering why this isn't working??
shouldn't it? am i doing something wrong?
have i not understood something?
(if you wanna make a bet, i have placed my money on the third alternative)
thank you in advance