Pulkit Pulkit - 7 months ago 20
Javascript Question

How to get width of div using jquery

How to get width of div using jquery

$("#window").width();
is not working

<div id="widnow"></div>


CSS:

#widnow{
width:500px;
border:solid 1px;
float:left;
}

Answer

It looks like you have made a simple mistake.

Try changing

$('#window').width();

to

$('#widnow').width();

From what you have displayed here, you have misspelled window.

-Mike