How do I remove the height style from a DIV using jQuery?

Solution 1:

to remove the height:

$('div#someDiv').css('height', '');
$('div#someDiv').css('height', null);

like John pointed out, set height to auto:

$('div#someDiv').css('height', 'auto');

(checked with jQuery 1.4)

Solution 2:

$('div#someDiv').height('auto');

I like using this, because it's symmetric with how you explicitly used .height(val) to set it in the first place, and works across browsers.

Solution 3:

you can try this:

$('div#someDiv').height('');

Solution 4:

maybe something like

$('div#someDiv').css("height", "auto");

Solution 5:

To reset the height of the div, just try

$("#someDiv").height('auto');