You can do something like this:
var myDiv = $("#myId"); alert('initial height from css is: ' + myDiv.css("height")); myDiv.css("height","50px"); alert('height modified by js is: ' + myDiv.css("height")); // store modified height value var height = myDiv.css("height"); // set height to an invalid value myDiv.css("height",""); alert('height is now retrieved from css again: ' + myDiv.css("height")); // restore height value myDiv.css("height",height);
I created an example on jsfiddle.net, you can view it here .
source share