<html>
<script type="text/javascript">
function Textor(txtid)
{
this.text=txtid;
this.init();
}
Textor.prototype.init=function()
{
this.text.onkeyup = function(oEvent)
{
alert('按键起来');
}
}
</script>
<script type="text/javascript">
window.onload = function () {
var txtor = new Textor(document.getElementById('username'));
}
</script>
<body>
<input type="text" name="username" id="username"/>
</body>
</html>
<script type="text/javascript">
function Textor(txtid)
{
this.text=txtid;
this.init();
}
Textor.prototype.init=function()
{
this.text.onkeyup = function(oEvent)
{
alert('按键起来');
}
}
</script>
<script type="text/javascript">
window.onload = function () {
var txtor = new Textor(document.getElementById('username'));
}
</script>
<body>
<input type="text" name="username" id="username"/>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货