JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" value="show width" />
.............................................................................................................................................................................................................................................................................
<div id="test" style="width: 200%; height: 50px; background: red;"><div style="width: 100%; height: 50px; background: red;"></div></div>
<div id="result"></div>
JavaScript
$(function() {
$("input").click(function() {
$("#result").html( "Total: " + jQuery(document).width() + "<br/>Window: " + jQuery(window).width() +
"<br/>Invisible width: " + (jQuery(document).width() - jQuery(window).width()) + "<br/> test Div width: " + jQuery("#test").width());
});
});