JavaScript
Article

jQuery Element Selectors

By Sam Deering

Using element selectors in jQuery means you can easily find HTML web page elements without manually finding the elements inside the HTML which can often be like finding a needle in a haystack.

With jQuery element selectors you can manipulate HTML elements and create JavaScript variables from them, assign events to them, animate them, edit them and much more!

The beauty of these special selectors is that a simple jQuery element selector line can find and select several HTML elements all at the same time! Magic.

Here is how you do it:

$("p") //selects all 

elements. $("p.intro") //selects all

elements with. $("p#demo") //selects the first

element with id="demo".

Check out the excellent jQuery Element Selector Tester.

Source:  http://www.w3schools.com/jquery/jquery_selectors.asp

  • Ankitaa_Luck

    Hello Everyone,
    JQuery selector is used to select HTML element by element name or attribute. JQuery selectors and attribute selectors are some of the best features. They allow you to quickly select all elements or groups of element of a given tag name, attribute name or their contents. In this example I am trying to change backcolor and forecolor of text that defined in element on mouse over………………………………… for more details check out the following link.
    http://mindstick.com/Articles/7cb3c8f0-2329-457e-9714-c65ba49aa826/?JQuery%20Element%20Selector#up

    Thanks !!!!!!!

Recommended
Sponsors
Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Get the latest in JavaScript, once a week, for free.