JSFiddle - React, Tailwind, and code Playground

HTML

<p id="myFragment">
     <i>F</i>RAGMENT <big><i>with italics</i> and </big> withOUT.
</p>

JavaScript

$('#myFragment *').each(function(){
       if ($(this).css('font-style')=='italic')
           $(this).css('font-style','normal');
});
$('#myFragment').parent().css('font-style','italic');

alert( $('#myFragment').html() );