Trying to get div dimensions in vh / vw instead of pixels
I am trying to have mutable divs in my application. For this, I need to save the changes specified by the user in my database.
My question is, how do I change the units given to me from px to something else? When I do this:
console.log(event.target.style.width)
it shows the width in px
. Is there a way to get it, say, %
or vh
/ vw
?
+3
source to share