JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parentel">
<img id="myimg" src="http://f00.inventorspot.com/images/panty-vending-machine.img_assist_custom.jpg" />
</div>
JavaScript
var imgw = $("#myimg");
var prt = $("#parentel");
prt.width(imgw.width());