Wednesday, September 26, 2012

What is jQuery selector

jQuery offers a powerful set of selector operations, which can be used like wild cards to identify specific elements in a page. 

jQuery selectors can be used to identify elements
          Based on type (Textbox, Checkbox, etc…)
          Based on attributes (ID, class, Name, Title, etc…)
          Based on wildcards (Starts with, Ends with, contains, etc...)      
          Based on the state of the element (Enabled, Visible etc …)
          Based on the Hierarchy (First, Last, nth, Parent, Child etc …)

The special characters used by the selectors are reserve words in jQuery, if you plan to use any of the selector special characters as name or id of a control then use them with the escape sequence characters \\ in jQuery.

For example: ! is a jQuery selector keyword.

If you want to refer to an element with name txt!Name in jQuery, you should use $("#txt\\!Name")

Search Flipkart Products:

No comments: