jQuery遍历之next()、nextAll()方法使用实例
jquery遍历:next()和nextAll()方法。实例如下:
<html> <head> <scripttype="text/javascript"src="jquery-1.8.2.min.js"></script> <scripttype="text/javascript"> $(document).ready(function(){ //$("div").click(function(){alert($(this).next().text());}); //$("div").click(function(){alert($(this).nextAll().text());}); $("div").click(function(){alert($(this).nextAll("div").text());}); }); </script> <styletype="text/css"> div{width:300px;height:30px;background:green;margin-top:10px;} </style> </head> <body> <divid="uu">您好,<fontcolor="blue">美女</font></div> <div>hello,world</div> <div>美女,亲一下</div> <p>我是p标签</p> <div><span>我很帅,有图有真相</span></div> <p>我也是p标签</p> </body> </html>
热门推荐
10 八一幼儿祝福语大全简短
11 公司乔迁食堂祝福语简短
12 婚礼结束聚餐祝福语简短
13 儿媳买车妈妈祝福语简短
14 毕业送礼老师祝福语简短
15 同事辞职正常祝福语简短
16 恭贺新婚文案祝福语简短
17 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短