function method1() {
var str = "border-left-color";
var array = str.split("-");
var newStr = "";
for (var i = 0; i < array.length; i++) {
newStr = newStr + (array[i].charAt(0).toUpperCase() + array[i].substr(1));
};
alert(newStr);
}
把border-left-color转换成BorderLeftColor
最新推荐文章于 2021-09-24 14:57:36 发布