Is there a way to retrieve the raw HTML of an element, or obtain the HTML without the "style" attribute applied? Let's consider the example below:
<div class="outer">
<div class="inner">
some text
</div>
</div>
After adding animation/CSS to the "inner" element:
$('.inner').animate({
'margin': '-10px'
});
Extracting the HTML of the "outer" element using console.log($('.outer').html());
, the result is as follows:
<div class="inner" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
some text
</div>
However, the desired outcome is:
<div class="inner">
some text
</div>
What is the most straightforward approach to achieving this? Avoiding the need to create a backup of the element prior to applying animate() or css().
Appreciate your assistance.