<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="ctl00_Head1"><title> Untitled Page </title> <script type="text/javascript" src="jquery-1.3.1.min.js" mce_src="jquery-1.3.1.min.js"></script> <script type="text/javascript"><!-- //注意一下next()和nextAll()的区别,next()只返回紧靠的同辈元素。 $(function(){ alert($(":checkbox").nextAll("span").html()); //返回正确的值 alert($("span").html()); alert($("div").next(".dd").html());//返回NULL }) </script> </head> <body> <form action="#"> <input id="ctl00_ContentPlaceHolder1_dlroot_ctl00_ckroot" type="checkbox" name="ctl00$ContentPlaceHolder1$dlroot$ctl00$ckroot" /> <label for="ctl00_ContentPlaceHolder1_dlroot_ctl00_ckroot">9000</label> <span>8000</span> <div></div> <span></span> <p class="dd">dsfasfdfa</p> </form> </body> </html> 本文来自优快云博客,转载请标明出处:http://blog.youkuaiyun.com/SEEKARMOR/archive/2009/08/17/4455446.aspx