How to get width of div using jquery


Tags: javascript,jquery,html,css

Problem :

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;
}


Solution :

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


    CSS Howto..

    How prevent inheriting “position: relative” CSS

    how to many class share 1 css method in CSS

    How to have an array of images side by side using css/html

    How to Disable button until required fields are filled without using javascript, just HTML5 and CSS

    How to re-use common css rules in css( sass ) [closed]

    How to position an icon in a metro-like web GUI? (images included)

    How to change the order of columns in CSS template to put important content first?

    how to make sure that that grid layout row adjusts the height automatically as per content

    How to make a css keyframe step animation responsive?

    How to apply gradient to element with correctly display in IE9?

    how do I properly position a button element with css?

    How to create an easy responsive grid with one column and two boxes?

    How to generate assets that match the html file of a rails application?

    How to use JavaScript OnResize with delay or less processing intensive

    How to transform a button into this styled button

    how to append an icon to an input search?

    How to set responsively images on images to appear fixed using HTML+CSS+JS?

    How to perform media queries if either statements are correct?

    How to keep an element fixed top within another element?

    How to Javascript to load a css file only for one specific page?

    How to make multiple divs always fill out the whole browser size?

    how to make multiple inline dropdown lists cross platform compatible?

    How to achieve the following design in css in jquery mobile

    how to create bar code like in a horizontal line using css (For Email)

    how to save style-css values for Later use then Reload those values back

    How to re-animate CSS3 animations on class change

    How to define a CSS fontface?

    HTML/CSS slight sideways scrollability, how to find source? [closed]

    How to fix misaligned rows alt the last records, after using vertical scroll and frozen column?

    How to use css transform-origin to show a circle of playing cards (rectangles)?