How to set width and height dynamically using jQuery
- by misha-moroshko
I would like to set the width and the height of the div element dynamically using jQuery.
I was trying to replace
<div id="mainTable" style="width:100px; height:200px;"></div>
with this:
$("#mainTable").css("width", "100");
$("#mainTable").css("height", "200");
but, it does not work for me.
Please help to understand why.