Reading webkitColumnCount

I can’t understand why I can’t read this CSS property (already stated in the CSS in the head of the document).


alert(div.style.webkitColumnCount);

This returns undefined, even though it’s set in the CSS (eg. -webkit-column-count: 6).

I can set the properties in JS, it just doesn’t seem to want to read them with this current syntax. Wondering if I am missing something really simple?

thanks.

turns out this worked for me, would love comments on if this is the best method though


document.defaultView.getComputedStyle(div, null).webkitColumnCount

thanks!