jQuery Tutorial


jQuery Example


jQuery References


jQuery CSS width() Method Reference


  jQuery CSS method References


Uses

jQuery width() method set set and return the width of selected elements.


Syntax

$(selector).width(value)  

jQuery CSS height() method Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
    $("p").width("200px");
  });
});
<script>
Online Try This Code Your Self....   »

jQuery width() method 2nd Syntax

$(selector).width()

jQuery width() method 2nd Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
    alert($("p").width());
  });
});
<script>
Online Try This Code Your Self....   »

  jQuery CSS method References