http://www.w3school.com.cn/tiy/t.asp?f=hdom_onkeyup 只允许用大写字母时的一种方法,不错哦!
<html>
<head>
<script type="text/javascript">
function upperCase(x)
{
var y=document.getElementById(x).value
document.getElementById(x).value=y.toUpperCase()
}
</script>
</head>
<body>
Enter your name: <input type="text" id="fname" onkeyup="upperCase(this.id)">
</body>
</html>
3376

被折叠的 条评论
为什么被折叠?



