You can create a hidden DOM element and add it to the body, and then delete:
$('<div class="my_class" style="display: none;"></div>').appendTo("body").css("attr1");
You will need to do something differently if you care about the property display, for example. use opacityeither visibilityor position: absolute; top: -100000px;.
source
share