Removing CSS property using jQuery

javascript, jquery

Solution

try this :

$('div').css({'width' : '', 'height' : ''});

or if there is a class, you remove it by:

$('div').removeClass('someClass');

Problem

Possible Duplicate: Is it possible to remove inline styles with jQuery? I'm building a javascript application doing something with images. At some point I'm having an element with inline style css-properties (width & height). I want to remove these properties with javascript/jQuery. I know you can set css-properties with .css() method. Is there a way to remove the properties like you do with .removeAttr()? Potential other css-properties should not be removed.

Original source

Related problems