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 婆婆66岁祝福语简短
13 今天孩子高考祝福语简短
14 送彩票生日祝福语简短
15 分别祝福语简短情话英文
16 画室揭牌仪式祝福语简短
17 女友妈妈生日祝福语简短
18 离别赠言离职祝福语简短