Question

I want to add the tbody below:

<tbody id="contact">
    ...
</tbody>

to a specified table:

<table id="target">
...
</table>
Was it helpful?

Solution

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>");

OTHER TIPS

Here's a better way :

$("#your_table_id > tbody ").append(yourhtml);
var tbody = "<tbody id='contact' />";

$("#target").append(tbody);
$("#target").append("<tbody id='contact'>content</tbody>");

Read

append

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top