使用javascript將background-Color修改為backgroundColor.
- function styName2ExpName(/*string*/styleName){
- return (
- /-(/w)/gi,
- function(){
- return arguments[1].toUpperCase();
- }
- );
- }
調用 styName2ExpName("background-Color") 返回 "backgroundColor "
調用 styName2ExpName("border-bottom-width") 返回 "borderBottomWidth"