October 31st, 2003, 03: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, 06:46 PM
October 31st, 2003, 10: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);
October 31st, 2003, 11:33 PM
Excellent! Thanks a lot!
Hello, old friend...