日期:2014-05-16 浏览次数:20876 次
<!DOCTYPE HTML> <html> <head> <meta charset="gb2312" /> <title></title> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <table> <tr> <td id="test1">test1</td> <td id="test2">test2</td> <td id="test3">test3</td> </tr> </table> <script> $('td').each(function(){ $(this).append('<input type="checkbox" id="'+this.id+'-checkbox">'); }) </script> </body> </html>
------解决方案--------------------
$(this).append('<input type="checkbox" id="'+this.id+'-checkbox">');