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 给外婆敬酒祝福语简短