Manipulating the DOM with jQuery

10+ Useful Code Snippets

The Document Object Model is an API which allows developers to access, read, and modify the content of a web page. In this article, I'm going to show you 10+ extremely useful code snippets to manipulate the DOM using jQuery.

  • Add a CSS Class to a specific element
  • Removing a CSS class from a specific element
  • Check if a specific element has a CSS class
  • Switch CSS using jQuery
  • Append HTML to an element
  • Check if an element exists
  • Get the parent element of an element
  • Get element siblings
  • Remove an option from a select list
  • Get the selected option as text
  • Apply a "zebra" effect on tables
  • Count children of an element

Comments

Be the first to write a comment

You must me logged in to write a comment.