JSFiddle - React, Tailwind, and code Playground

HTML

<div id="result"></div>
<div id="A">
    Hello
    <div style="float:right">World</div>
</div>

JavaScript

$('#result').html(
    "Hidden:"+$('#A').hide().height()+'px<br>' +
    "Visible:"+$('#A').show().height()+'px<br>'    
);