日期:2014-05-16 浏览次数:20421 次
<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>JQuery动态添加table的tr td</title> <script type="text/javascript" language="javascript" src="jquery-1.6.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".os-content tr:eq(1) td:eq(1)").after("<td>王五</td>"); }); </script> </head> <body> <table class="os-content" id="b1" border=1> <tbody> <tr><td style="">张三</td></tr> <tr> <td> <table border=1> <tr><td>李四</td></tr> <tr><td>钱七</td></tr> </table> </td> <td>赵六</td> </tr> </tbody> </table> </body> </html>