Skip to content

Instantly share code, notes, and snippets.

@avireni
Created April 13, 2012 23:13
Show Gist options
  • Select an option

  • Save avireni/2380726 to your computer and use it in GitHub Desktop.

Select an option

Save avireni/2380726 to your computer and use it in GitHub Desktop.
Check If An Element contains a certain class or element
//jQuery 1.4.* includes support for the has method. This method will find
//if a an element contains a certain other element class or whatever it is
//you are looking for and do anything you want to them.
$("input").has(".email").addClass("email_icon");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment