By Sam Deering

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.


  • 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.

    Thanks !!!!!!!

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