add class jquery

JavaScript
$( "p" ).addClass( "myClass yourClass" );
$("#elem").addClass("classname");$("#my_id").attr("class", "my_new_class_name");$( "p" ).removeClass( "myClass noClass" ).addClass( "yourClass" );

Source

Also in JavaScript: