You can use the addClass() and removeClass() methods to do the same.
$("h1").addClass("myclass");
$("h1").removeClass("myclass");
Question: Can you write a jQuery code to select all links inside the paragraph?
Answer:
$('a:visible').css('text-transform', 'uppercase');