JSFiddle - React, Tailwind, and code Playground

HTML

<div id="widthTestOuter" style="margin:5px;background-color:#369;">
        <div style='position:relative;'>
            <div id="widthTestInner" style="width:100%;height:350px; background-color:#EEE"></div>
        </div>
</div>


<div>width() vs. .css("width")</div>
    <div id="showWidthFN"></div>
    <div id="showWidthCSS"></div>

JavaScript

$(document).ready(function() {
    
    var hiddenWidthTextElm = $('#widthTestInner');
        var widthFNVal = hiddenWidthTextElm.width();
        $('#showWidthFN').html(widthFNVal);
        $('#showWidthCSS').html(hiddenWidthTextElm.css('width'));
});