Skip to content

Instantly share code, notes, and snippets.

@DaveGoosem
Created May 8, 2013 08:08
Show Gist options
  • Save DaveGoosem/5538966 to your computer and use it in GitHub Desktop.
Save DaveGoosem/5538966 to your computer and use it in GitHub Desktop.
Manipulating the DOM
//lets you add something in the DOM directly after the DOM element you target.
.append()
//lets you add something in the DOM directly before the DOM element you target.
.prepend()
.after()
//lets you place something in the DOM directly above, at the same level the item you target.
.before()
.appendTo()
.prependTo()
.insertAfter()
.insertBefore()
//removed targeted DOM element
.remove()
//finds the ancestor of the selected DOM element and only will affect that one.
.closest()
//find a particular DOM element
.find(<element>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment