如下:
代码如下: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> </head> <body> <table > <tr> <td width="225" height="225" style="border-left:1px solid black;border-right:1px solid black;border-top:1px solid black;border-bottom:1px solid black;">1</td> <td width="225" height="225" style="border-left:1px solid black;border-right:1px solid black;border-top:1px solid black;border-bottom:1px solid black;">2</td> <td id="kk" width="225" height="225" style="border-left:1px solid black;border-right:1px solid black;border-top:1px solid black;border-bottom:1px solid black;">3</td> </tr> </table> <script> var t =$("#kk").prev().html();//结果是:2 alert(t); </script> </body> </html> |