Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Accessing Parents, children, sibling

You can access any time the parent element, the children elements or sibling elements by using these JQuery functions. For example:

$(element).parent() => return the parent element of the selected element.

$(element).children() => returns all direct children nodes of the element.

$(element).siblings() => returns all siblings elements of the element.

$(element).find('p') => returns all paragraphs that are descendants of the element.

Docs for accessing ancestors

Docs for accessing descendants

Docs for accessing siblings

Traversing the DOM

Kostas Diakogiannis
Module by Kostas Diakogiannis, updated more than 1 year ago
No tags specified