These are just a few quick tips that I stumbled across a few seconds ago to bear in mind when working with CSS in JavaScript.
Tip 1:Compounded CSS attributes lose the hyphen and the second (third, forth, etc) word have an Upper Case first letter. For example: background-color (in CSS style) becomes backgroundColor (in JavaScript) and text-align (in CSS style) becomes textAlign (in JavaScript).
Tip 2:Compounded HTML attributes use Upper Case first letter for second (third, forth, etc) word. For example: colSpan, bgColor, readOnly
Tip 3: HTML "class" becomes JavaScript "className".
These tips were sourced from this web developer forum.
(I must say that I've only validated Tip 1. Feel free to comment on any of the others.)
tagged: techie // Comments [0]
Related posts:13 Predictions for 2009Why “Open Source” misses the point of Free SoftwareTop 25 days in computing historyHow 10 Famous Technology Products Got Their NamesGoogle pushing Chrome via YoutubeGoogle's Android mobile unveiled
Disclaimer The posts on this blog are provided "AS IS" with no warranties. The opinions expressed herein are my own personal opinions and do not represent any other person's views in anyway.