87,910
社区成员
发帖
与我相关
我的任务
分享
$("#area").click(function(event){
event.stopPropagation();//阻止冒泡
});
<html>
<head>
<script src='http://code.jquery.com/jquery-latest.js'></script>
<script>
$(function(){
var $wori=$('body :not(:has(#area),#area)')
$wori.each(function(){
alert($(this).attr('id'))
})
})
</script>
</head>
<body>
<div id='a'>123</div>
<div id='b'>456</div>
<div id="div1">
<textarea id="area"></textarea>
</div>
</body>
</html>