62,041
社区成员
发帖
与我相关
我的任务
分享
<input id="txtUserName" type="text" value="123" onblur="CheckBlur(this)" />
<input type="button" value="Test" onclick="TestBlur();" />
<script type="text/javascript">
function CheckBlur(send) {
if (send.value != "") {
send.focus();
send.select();
}
}
function TestBlur() {
var send = document.getElementById("txtUserName");
CheckBlur(send);
}
</script>
<!--ie ff测试成功-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
</head>
<body>
<input id="txtUserName" type="text" value="123" onblur="CheckBlur(this)" />
<input type="button" value="Test" onclick="TestBlur();" />
<script type="text/javascript">
function CheckBlur(send) {
if (send.value != "") {
window.setTimeout(function(){
send.focus();
send.select();},1)
}
}
function TestBlur() {
var send = document.getElementById("txtUserName");
CheckBlur(send);
}
</script>
</body>
</html>