jQuery 抄袭笔记(14) : Parent()(2)
16 Oct 2011this.parent()是input前面的td this.parent().parent()获取的是tr this.parent().parent().parent()获取的是table this.parent().next()获取的是td相临的td
01 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
02 <html xmlns=“http://www.w3.org/1999/xhtml”>
03 </span>
04 <meta http-equiv=“Content-Type” content=“text/html; charset=gb2312″ />
05</span>Hello Lazynight!</title>
06 <script type=“text/javascript” src=“http://www.cssrain.cn/demo/jquery.js”></script>
07 <script type=“text/javascript”>
08 $(document).ready(function(){
09 $(“#Lazy_btn”).click(function(){
10 alert($(this).parent().next().html());
11 });
12 });
13 </script>
14 </head>
15 </span>
16</span>
02 <html xmlns=“http://www.w3.org/1999/xhtml”>
03 </span>
04 <meta http-equiv=“Content-Type” content=“text/html; charset=gb2312″ />
05
06 <script type=“text/javascript” src=“http://www.cssrain.cn/demo/jquery.js”></script>
07 <script type=“text/javascript”>
08 $(document).ready(function(){
09 $(“#Lazy_btn”).click(function(){
10 alert($(this).parent().next().html());
11 });
12 });
13 </script>
14 </head>
15 </span>
16
<input</span> id=“Lazy_btn” class=“btn” type=“button” value=“text”/></td> 19 | </span>Lazynight | 夜阑 欢迎您!</td> 20 21 </span> |