Getting width of div class row
I need to get the width of this div
<div class='row WidthAdjust'></div>
But it is proving way more difficult than I anticipated, below is some of the things I have already tried
// var row = document.getElementsByClassName("WidthAdjust").width()
var row = document.getElementsByClassName("WidthAdjust")
var rowWidth = parseFloat($(row).width())
Solution 1:
You can use var data = row.getBoundingClientRect()
to get DOMRect
object. This object will have the size of the element and its position relative to view port.
Use data.width
to get the width specifically.