jquery addclass
snippet in javascript

jquery addclass

user7957

$("#elem").addClass("classname");

jquery addclass

user6680

$( "p" ).addClass( "myClass yourClass" );

add class jquery

user4578

$("#my_id").attr("class", "my_new_class_name");

jquery addclass

user1637

$( "p" ).removeClass( "myClass noClass" ).addClass( "yourClass" );