clarkk
clarkk

Reputation: 1

get style.width when property set with className

How can you get the property style.width if it is set with className?

Upvotes: 1

Views: 865

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385385

It sounds like you need a node's computed width, which is its physical width after all styles are applied.

See here for how.

As you can see, elementNode.offsetWidth appears to be the most portable.

Upvotes: 1

Related Questions