开发者

Cross browser adding row to table- JQuery?

开发者 https://www.devze.com 2023-04-02 12:23 出处:网络
Does anyone know a good way to dynamically add a row to a tab开发者_JAVA技巧le in jQuery?Technically for a cross browser implementation you should do $(\'table tbody\').append(\"Foo\")

Does anyone know a good way to dynamically add a row to a tab开发者_JAVA技巧le in jQuery?


Technically for a cross browser implementation you should do $('table tbody').append("Foo")

Since IE doesn't automatically add the tbody for you but other browsers do.


Try

$('table').append('<tr><td>Foo</td></tr>');
0

精彩评论

暂无评论...
验证码 换一张
取 消