js中文字框的事件

weixin_34120274發表於2012-11-22

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
<script type ="text/javascript" >
function Blur() {
alert("游標離開文字框");
}


function Focus() {
alert("游標進入文字框");
}

function keydown(e) {
alert("在文字框中輸入字元");
}
</script>
</head>
<body>
<input type ="text" onblur ="Blur()" onfocus ="Focus()" onkeydown ="keydown(this)" />
</body>
</html>

相關文章