onchange

http://www.w3school.com.cn/tiy/t.asp?f=hdom_onchange

 

<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" onchange="upperCase(this.id)">

</body>
</html>

posted on 2017-10-10 15:07  java8090  阅读(127)  评论(0)    收藏  举报

导航