jQuery innerWidth () method
Examples
Back inside width of <div> element:
$("button").click(function(){
alert($("div").innerWidth());
});
alert($("div").innerWidth());
});
try it"
Definition and Usage
innerWidth () method returns the first matching element of internal width.
As shown in the following image, the method comprising padding, but not border and margin.
Related methods:
- width () - Sets or returns the width of the element
- height () - Sets or returns the height of an element
- innerHeight () - Returns the height of an element (including padding)
- the outerWidth () - Returns the element's width (including padding and border)
- outerHeight () - Returns the height of an element (including padding and border)
grammar
$(selector).innerWidth()
More examples
Display size by related methods
How to use the width (), height (), innerHeight (), innerWidth (), outerWidth () and outerHeight ().