Given this HTML, CSS, and JavaScript: http://jsfiddle.net/XvqYS/3/
If you run it on Google Chrome it alerts
10px
Running it on IE, Safari, or FireFox alerts and empty string. Why?
I’m using IE9, Chrome 18.0.1025.168, FireFox 12.0, Safari 5.0.4
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Individual properties, such as
margin-lefthave to be used.The basic method to read all properties is: http://jsfiddle.net/XvqYS/8/
You can tweak it to return a compact value, eg.
10px 10px 10px 10px->10px.