JSFiddle - React, Tailwind, and code Playground

by Dineshkani

HTML

<div id="firstdiv" class="sample">
    	     Hello Jquery
</div><br/><br/>
<div id="secondiv" class="sample">
    	     Hello Javascript
</div>

CSS

.sample{
    width: 250px;
    background-color: grey;
    color: white;
    text-align: center;
    height: 80px;
    line-height: 80px;
    padding: 10px;
}

JavaScript

//In jquery

alert("Jquery::"  + $("#firstdiv").width());
$("#firstdiv").width("350px");

//In javascript

alert("Javascript::" + window.getComputedStyle(document.getElementById("secondiv")).getPropertyValue("width"));
document.getElementById("secondiv").style.width = "400px";