jQuery innerWidth()
The jQuery innerWidth()
method is used to get the inner width of the selected element. This includes the padding but excludes the border and margin of the element.
Syntax
The syntax for using jQuery innerWidth()
method is as follows:
$(selector).innerWidth();
Use
The innerWidth()
method is useful when you need to get the actual inner width of an element for calculating the correct size or position of an element within its parent element.
Example
Here is an example of using jQuery innerWidth()
method to get the inner width of an element: