I want to add the tbody below:
<tbody id="contact"> ... </tbody>
to a specified table:
<table id="target"> ... </table>
Here's a better way :
$("#your_table_id > tbody ").append(yourhtml);
Ripped off the jQuery docs, you can use
$("p").append("<strong>Hello</strong>");
So in your case it'll be
$('#target').append("<tbody id=\"contact\">...</tbody>");
var tbody = "<tbody id='contact' />"; $("#target").append(tbody);
$("#target").append("<tbody id='contact'>content</tbody>");
Read
append