Jquery Selectors with Some Examples
- are used to select single or a group of HTML elements from your webpage.
- support all the custom selectors as well as CSS selectors.
- starts with a dollar symbol and parentheses: $().
Three blocks to select the HTML elements are as follow:
- Select HTML elements by ID. For an Example: $(#testID”) It select an element which has an ID called 'testID'
- Select elements by class. For an Example: $(“.testClass”) It will select all the elements have a class called 'testClass'
- Select elements by tag name For an Example: $(div) It will select all the div elements in the document.