Can jQuery provide the tag name?

You could try this:

if($(this).is('h1')){
  doStuff();
}

See the docs for more on is().

Leave a Comment