I'm currently working on an app where I want the divs to be resizable. In order to achieve this, I need to store the user's changes in my database.
My main concern is how can I convert the units provided in pixels (px) to a different unit of measurement? For instance, when I use:
console.log(event.target.style.width)
it displays the width in px
. Is there a way to retrieve it in, let's say, %
, vh
, or vw
instead?