toUpperCase() and toLowerCase()

toUpperCase() 大写

toLowerCase() 小写

例如:

<html>

<head>

<script type="text/javascript">

function upperCase(x)

{

var y=document.getElementById(x).value

document.getElementById(x).value=y.toLowerCase()

}

</script>

</head>

<body>

输入些字母:

<input type="text" id="code"onchange="upperCase(this.id)">

</body>

</html>

posted on 2010-12-15 12:57  backslash112  阅读(323)  评论(0编辑  收藏  举报

导航