4

How can I get the computed border width of a HTML element in Javascript? (Independent of where and how the border is specified.)

2
  • Can the four sides have different widths or will they be set constantly to the same width? Commented Aug 25, 2010 at 19:20
  • @Pekka: Yes, they can have different widths. Commented Aug 25, 2010 at 19:44

1 Answer 1

5

You want something like window.getComputedStyle(), but that's not a 100% cross-browser function - you'll have to work a little harder for that.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.