• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

JQuery Selectors

May 6, 2014 //  by Krishna Srinivasan//  Leave a Comment

The jQuery selectors are important aspects of the jQuery library. The jQuery selectors allow page elements to be selected. It supports selection of single element or multiple elements. These selectors use CSS syntax which allows identifying set of elements to operate upon with jQuery library methods. The important purpose of jQuery selector is to select elements and perform some actions on the selected elements. The jQuery selectors searches or selects HTML elements and performs intended action on those elements. jQuery selectors is one of the most powerful mechanism used in jQuery to search the elements. This concept is borrowed from the CSS language.

A selector identifies HTML element which will manipulate with jQuery code. A jQuery selector uses expressions to find out matching elements in the set of matched elements from the DOM. All types of jQuery selectors start with dollar sign and parentheses. i.e. $( ).

The table shows list of jQuery selectors with description.

Selector Description
(“*”) It selects all the elements.
(“#id”) It selects elements by ID attribute.
(“.class”) It selects elements by class name.
tag It selects all the p elements.
:first-child selector It selects first matched element of their parent element on the page.
:last-child selector It selects last matched element of their parent element on the page.
:not selector It selects all the elements except the specified element that do not match given selector.
:gt() selector It returns all the elements which are greater than index value.
:lt() selector It returns all the elements which are less than index value.
:even selector It selects all the elements that have even index value.
:odd selector It selects all the elements that have odd index value.
:enabled selector It selects all the elements that are enabled.
:disabled selector It selects all the disabled elements.
:selected selector It selects all the elements that are in selected state.
:checked selector It selects all the elements that are checked or selected.
:input selector It selects all the input elements from input, select, textarea, button elements.
:text selector It selects all the elements that are of type text.
:button selector It selects all the elements that are of type button.
:has selector It selects all the elements with a descendant that matches specified selector.
:password selector It selects all the elements that are of type password.
:radio selector It selects all the elements that are of type radio.
:checkbox selector It selects all the elements that are of type checkbox.
:image selector It selects all the elements that are of type image.
:file selector It selects all the elements that are of type file.
:submit selector It selects all the elements that are of type submit.
:reset selector It selects all the elements that are of type reset.
:animated selector It selects all the elements that are under animated control.
:header selector It selects all the headers from h1 through h6.
:hidden selector It selects all the hidden elements.
:visible selector It selects all the visible elements.
:empty selector It selects all the elements which have no child elements.
:parent selector It selects all the elements that are parent to other elements including text nodes.
:contains selector It selects all the elements that contains the text.
[attribute] It selects all the elements that have attribute name or attribute value.
[attribute$=value] It selects all the elements that ends with a given string.
[attribute=value] It selects all the elements that equal to a certain value.
[attribute*=value] It returns all the elements that passed attribute value contains the passed value.
[attribute!=value] It selects all the elements that do not equal to certain value.

Category: jQueryTag: JQuery Selectors

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Previous Post: «jquery JQuery Position() and Offset() Example
Next Post: JQuery : Difference Between detach(), hide() And remove() Methods jquery»

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

New Features in Spring Boot 1.4

Difference Between @RequestParam and @PathVariable in Spring MVC

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact