Home > UI/UX Development > jQuery > What is the difference between jQuery HTML/CSS methods width(), innerWidth(), outerWidth() and outerWidth(ture)?

What is the difference between jQuery HTML/CSS methods width(), innerWidth(), outerWidth() and outerWidth(ture)?

This post was most recently updated on October 10th, 2017

Definition:

width(): This method gives width of the selected element (excluding padding, border and margin).

innerWidth(): This method gives width of the selected element (including padding, excluding border and margin).

outerWidth(): This method gives width of the selected element (including padding and border, excluding margin).

outerWidth(true): This method gives width of the selected element (including padding, border and margin).

HTML:

Explanation: The yellow box shown below with dimensions and the output when you click on click on respective buttons given below.

To see more details click here for DEMO page.

This Article is TAGGED in , , , . BOOKMARK THE permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">