- $("#section1").add("p")
- Selects #section1 and then adds all the paragraphs
- $("p").filter(".important")
- Selects all the paragraphs where the class = important
- $("p").not(".important")
- Excludes all the paragraphs where the class = important
- $("p").filter(".important").end()
- Cancels the filter operation
- $("#section1").parent()
- Selects #section1 and then adds all the paragraphs
- $("p").parent("#section1")
- Selects the parent element of all the paragraphs who ID
is section1
- $("#section1").children()
- Selects all the children of #section1
- $("#section1").children("p[b]")
- Selects all the child paragraphs of #section1 with bold text
- $("#section1").children("b")
- Selects all direct children bold text. (None should come up)
- $("#section1").find("b")
- Finds all children and grand chilren bold text elements.
- $("#section1 p").contains("Third")
- Selects all our paragraphs which contain the text Third
- $("#section1").next()
- Selects the next sibling of #section1