JavaScript toLowerCase() 方法


定义和用法

toLowerCase() 方法用于把字符串转换为小写。

语法
  1. stringObject.toLowerCase()
返回值

一个新的字符串,在其中 stringObject 的所有大写字符全部被转换为了小写字符。


实例

在本例中,"Hello world!" 将以小写字母来显示:

  1. <html>
  2. <body>
  3. <script type="text/javascript">
  4. var str="Hello World!"
  5. document.write(str.toLowerCase())
  6. </script>
  7. </body>
  8. </html>

分类导航