JSFiddle - React, Tailwind, and code Playground

HTML

<div class="a" style="width:40px">This element might have a width of 100px</div>
<div class="a" style="width:60px">..while this one might be 50px</div>
<div class="a" style="width:10px">..and this one is maybe 75px</div>
<div class="b">give me the 100px width</div>
<div class="b">and me the 50px width</div>
<div class="b">and me the 75px width</div>

JavaScript

$('.a').each(function(index) {
    var thisWidth = $(this).width();
    $('.b').eq(index).width(thisWidth);
})