你可以用js去控制啊推荐你去看看jquery,这个很容易懂的..也很好用.
div要想有focus和blur事件时用加上一个属性 tabindex 如: <div tabindex="2"></div> 这样就有onfocus和onblur事件了.
<div id= "test " onclick= "this.style.display= 'none; ' "> </div>
重写该div的 onclick事件 = function (){return true;}
div可以添加onclick
div没有焦点事件,所以这个不好实现.为什么非得用div呢?用input这类表单元素不行?说下你的需求吧
你好,DOM中的元素DIV不支持失去焦点事件onblur.支持失去焦点的元素有button, checkbox, fileUpload, layer, frame, password, radio, reset, submit, text, textarea, window.没有包括div你可以让某个事件发生的时候尝试让这个div隐藏,比如你
<script type='text/javascript' src="jquery-1.3.2.js"></script><script>$(function(){ $('#parent').bind('click',function(event){ if(event.target.id=='parent'){ alert(); } })/* 这个方法也行$('#parent').parent().click(function(){do someting
子div的click事件里面写: $(this).parent().click(); return false;
设置 iframe 的 onclick 事件,或者是 iframe中元素的 onclick 然后在这个事件中 再调用 div 的click事件