check if class has element jquery code example Example: jquery hasclass $( "#mydiv" ).hasClass( "foo" )