jQuery hapus kelas css
$("p").removeClass( "myClass yourClass" )
Doubtful Dog
$("p").removeClass( "myClass yourClass" )
$("div").removeClass("important");
addClass() - Adds one or more classes to the selected elements
removeClass() - Removes one or more classes from the selected elements
toggleClass() - Toggles between adding/removing classes from the selected elements
css() - Sets or returns the style attribute
$("#id").css({ 'background-color' : '', 'opacity' : '' });
$(".class").css({ 'background-color' : '', 'opacity' : '' });
//You can remove css by the above.
$("#id .class").css({ 'background-color' : '' });
/*
As mentioned in the jquery documentation:
Setting the value of a style property to an empty string
removes that property from an element
if it has already been directly applied
e.g. $('#mydiv').css('color', '')
*/
$("#div1").on("click", function () {
if ($(this).hasClass("active")) {
setTimeout(function () {
$("#div1").removeClass("active");
}, 10);
}
});
$('.tag-class').removeAttr('style');