Answers for "if element has no class jquery"

19

jquery hasclass

if ($( "#foo" ).hasClass('className')) {
	$( "#foo" ).removeClass( 'className');
} else {
  $( "#foo" ).addClass( 'className');
}
Posted by: Guest on July-01-2020
1

has not class jquery

if (!$(this).hasClass("test")) {
Posted by: Guest on March-01-2021

Code answers related to "if element has no class jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language