js方法基础方法补充

292 阅读1分钟

转化大写

js字母大小写转换方法:

1、转换成大写:toUpperCase()

2、转换成小写:toLowerCase()

(1)var a="aBcD";
        a=a.toUpperCase();
        alert(a);
        提示出来的就是 ABCD
(2)var a="aBcD";
        a=a.toLowerCase();
        alert(a);
        提示出来的就是 abcd