Hi all... I need someone to write a regular expression or some code to extract elements from this string: .at_1272 { width:325px; height:100px; background-color: none; padding: 3px; } I want to extract the values of width and height. So width=325px and height=100px I need them in two javascript variables. If someone can write that I'd appreciate!
why dont you just use... var width = document.getElementsByClassName.style.width; var height = document.getElementsByClassName.style.height; ??
Well Ive had no luck.... how can I use: var width = document.getElementsByClassName.style.width; var height = document.getElementsByClassName.style.height; To get those values? Ive tried: document.getElementsByClassName['at_1272'].style.width; But it doesnt work.
Well no I cant I am in a dev environment locally. When I use that notation I get: document.getElementsByClassName has no properties
Here look at this: http://www.modyourcar.com.au/style_test.html It should pop up an alert with the value of width, but it errors.
document.getElementsByClassName Isn't implemented yet except for in a few browsers. Use something like: document.getElementById('id').style.width;