1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>test</title> 5 </head> 6 <body> 7 <input id = "box" type = "text" /> 8 </body> 9 <script type="text/javascript"> 10 window.onload = function() { 11 var inputBox = document.getElementById("box"); 12 inputBox.focus(); 13 var close = setTimeout(function() { 14 inputBox.blur(); 15 },3000); 16 } 17 </script> 18 </html>
<script>
var $ = function (id) {
return document.getElementById(id);
}
</script>
<input type="text" id="chu" value="" onblur="alert(0)">
<input type="button" value="取消" onclick="$('chu').onblur = 'return false;'">
unbind();..