87,910
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>demo</title>
<script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
<style type="text/css">
body {text-align: center;}
.wrap0 {width:1000px;height:1000px;background-color: #96363c;}
.wrap1 {width:800px;height:800px;background-color: #933696;}
.wrap2 {width:600px;height:600px;background-color: #363696;}
.wrap3 {width:400px;height:400px;background-color: #369648;}
.wrap4 {width:200px;height:200px;background-color: #fbe705;}
</style>
</head>
<body>
<div class="wrap0">
<input type="text"/>
<div class="wrap1">
<input type="text"/>
<div class="wrap2">
<input type="text"/>
<div class="wrap3">
<input type="text"/>
<div class="wrap4">
<input type="text"/>
<input type="text"/>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
$("input[type='text']").each(function(){
$(this).focus(function(){
$("body").one('click',function(){
alert ("a");
return false;
});
// $("body").click(function(){
// alert ("a");
// return false;
// });
});
});
})
</script>
</body>
</html>