JSFiddle - React, Tailwind, and code Playground

by yasemin Cerrahoğlu

HTML

<div id="container" style="border: 1px solid; height: 100px; width: 500px; overflow:hidden">
  <div id="kac" style="background:red;width: 1200px; height:800px; ">
  
  </div>
</div>

JavaScript

var rect = document.getElementById('kac').getBoundingClientRect();
var height = rect.height;
var width = rect.scrollWidth;
 console.log(rect);
alert(`${rect} `);