why javascript this.style[property] return an empty string? [duplicate]

The .style property is for getting styles that were placed directly on the element. It doesn’t compute styles from your stylesheets.

See getComputedStyle().

Leave a Comment