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 生日广州男生祝福语简短