JSFiddle - React, Tailwind, and code Playground

by softvar

HTML

<div id="a1" class="vwo">abc</div>
<div id="a2" class="vwo">def</div>
<div id="a3" class="noclass">ghi</div>
<div id="a4" class="vwo">jkl</div>
<div id="a5" class="vwo">mno</div>

CSS

#a1{
    color:red;
}
#a2{
    color:green;
    margin-left:30px;
}
#a3{
    color:grey;
    
}
#a4{
    width:20px;
    height:40px;
    background:red;
}
#a5{
    background: green;
    height:100px;
}

JavaScript

$(function(){
    var eleModified = $(".vwo").length;

    $(".vwo").each(function(){
        var width = $(this).width(),
            height = $(this).height(),
            top = $(this).offset().top,
            left = $(this).offset().left; 
        var data = '{"height":'+height+',"width":'+width+',"top":'+top+',"left":'+left+'}';
        var _json = JSON.parse(data);
        console.log(_json);
    });
});