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 宝宝100日简短祝福语
16 电力考试祝福语简短高级
17 女性生日祝福语简短优美
18 感恩父亲贺卡祝福语简短