Get the width and height of an certain container using jquery

by aljon254

HTML

<div class="container">    
    the div    
</div>

CSS

.container{
    width:500px;
    height:350px;
    background:#333;
    
}

JavaScript

theWidth = $('.container').width();
theHeight = $('.container').height();

alert('the width is : ' + theWidth + 'px and the height is : ' + theHeight + 'px');