jquery remove css code example

Example 1: how to remove css from element using jquery

$('#tag-id').removeAttr('style');

Example 2: jquery remove css class

$("p").removeClass( "myClass yourClass" )

Example 3: jquery remove css style

//removing css with jQuery. i.e: set to default 
$( "#myElementID" ).css("background-color", "");//just blank it out

Example 4: js remove specific css property

// OPTION 1:

el.style.removeProperty('zoom');

// OPTION 2:

el.style.zoom = "";

Example 5: remove css jquery

$("#id").css({ 'background-color' : '', 'opacity' : '' });
$(".class").css({ 'background-color' : '', 'opacity' : '' });
//You can remove css by the above.

Example 6: jquery remove css

$("#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', '')
*/

Tags:

Misc Example