jQuery Tutorial
jQuery innerWidth() Method With Syntax and Example
Table of Contents
- Understanding innerWidth method in jQuery
- Syntax of innerWidth method in jQuery
- Example of jQuery innerWidth method
Understanding innerWidth method in jQuery
The innerWidth()
method returns the first matched element's inner width.
This method includes padding but not border or margin, as shown in the image below.
Syntax of innerWidth method in jQuery
$(selector).innerWidth()
Example of jQuery innerWidth method
Return the inner width of a
element:
$("button").click(function(){
alert($("div").innerWidth());
});