var element = $("img");
will set the variable element to the second <img> element in the matched set of document's all <img> elements.
Hot Tip #2: Create Union of Elements with Multiple Selectors
Union of multiple selectors can be created by listing selectors separated by commas 'n a s'ngle call to $()
will match all <img> and <p> elements, while the following matches all <div> elements with a title attribute and all <img> elements with alt attributes.
Hot Tip #3: Be Careful with not() and remove() methods!
.not() method removes elements from the matched set while the .remove() method removes the elements in the matched set from the HTML DOM.
Want automatic updates?
Subscribe to our RSS feed
Get Email Updates
sent directly to your inbox!