现在的位置: 首页 > 综合 > 正文

div 触发失去焦点事件

2019年05月31日 ⁄ 综合 ⁄ 共 595字 ⁄ 字号 评论关闭
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>div 触发失去焦点事件</title>
</head>
<body>
<h1>设置tabindex属性可触发焦点事件</h1>
<div style="float:left;">

<div id="birthday__jQSelect0" class="dropdown" tabindex="0">
<li>测试一下 </li><li>测试一下 </li><li>测试一下 </li>
</div>

<script type="text/javascript">
document.getElementById('birthday__jQSelect0').onmouseover = function(){
document.getElementById('birthday__jQSelect0').focus();
return false;
}
document.getElementById('birthday__jQSelect0').onblur = function(){
alert("jjjjjj");
return false;
}
</script>


<iframe height="100" src="aa.html">
</iframe>
</body>
</html>

抱歉!评论已关闭.