October 31st, 2003, 04:19 PM
DOM 2 (question about CSS)
I am able to do this, to retrieve a value as a string:
This will give me a string, e.g. '100px'
But what I want is just the numeric value, i.e. 100, so that I can use it in a math formula.
How can I do this?
October 31st, 2003, 07:46 PM
October 31st, 2003, 11:56 PM
You could make it Mozilla-compatible as well:
var ss = document.styleSheets.item(0);
var rules = ss.cssRules || ss.rules;
var width = parseInt(rules.item(0).style.width);
November 1st, 2003, 12:33 AM
Excellent! Thanks a lot!
Hello, old friend...