Set height of any element using JQuery

Posted by Virendradugar under jQuery category on | Views : 26396
Below code will set/overwrite the width of dvWidth element using JQuery. You can download the Jquery from

<script type="text/javascript" src="Script/jquery-1.3.2.js"></script>

<script type="text/javascript">





<div id="dvWidth" style="width:200px;height:50px">

<h1>Virendra Dugar</h1>



Comments or Responses

Posted by: Suresh44t on: 12/24/2012 Level:Starter | Status: [Member] | Points: 10
<!DOCTYPE html>

body {background:#F1F1A8;}
<script src=""></script>
$("p").append($("p").height()+" px");
$("div.divContainer").append($("div.divContainer").height()+" px");
$("div.document").append($(document).height()+" px");
$("div.window").append($(window).height()+" px");
<div class="document">Height of this document is: </div>
<div class="window">Height of this window is: </div>
<div class="divContainer">Height of this div container is: </div>
<p>Height of this paragraph is: </p>


Login to post response