| Start |
|---|
| Select children of element To select the children of an element you can use the Change the color of all the children of the The method accepts an optional |
| Iterating over list of jQuery elements When you need to iterate over the list of jQuery elements. Consider this DOM structure: To print the text present in all the Tip: |
| Selecting siblings To select siblings of an item you can use the A typical example where you want to modify the siblings of an item is in a menu: When the user clicks on a menu item the The method takes an optional |
| closest() method Returns the first element that matches the selector starting at the element and traversing up the DOM tree. HTML jQuery OUTPUT first() method : The first method returns the first element from the matched set of elements. HTML JQuery Output: |
| Get next element To get the next element you can use the If you are standing on the "Anna" element and you want to get the next element, "Paul", the The method takes an optional If the next element is not of the type |
| Get previous element To get the previous element you can use the If you are standing on the "Anna" element and you want to get the previous element, "Mark", the The method takes an optional If the previous element is not of the type |
| Filter a selection To filter a selection you can use the The method is called on a selection and returns a new selection. If the filter matches an element then it is added to the returned selection, otherwise it is ignored. If no element is matched then an empty selection is returned. The HTMLThis is the HTML we will be using. SelectorFiltering using selectors (opens new window) is one of the simpler ways to filter a selection. FunctionFiltering a selection using a function (opens new window) is useful if it is not possible to use selectors. The function is called for each element in the selection. If it returns a ElementsYou can filter by DOM elements. If the DOM elements are in the selection then they will be included in the returned selection. SelectionYou can also filter a selection by another selection. If an element is in both selections then it will be included in the returned selection. |
| find() method .find() method allows us to search through the descendants of these elements in the DOM tree and construct a new jQuery object from the matching elements. HTML jQuery Output |
Read Article
https://develop.horje.com/learn/1434/reference