Append data to table tbody

Hi

I’m trying to append data to a tbody but for some reason the html tags are removed. It only works if I call .html method.

Ex.

$$('#test').find('tbody').append('<tr><td>Data</td></tr>');

This only append “Data” to the table and remove all the html tags.

This works
$$('#test').find('tbody').html('<tr><td>Data</td></tr>');

Any advise?

Thanks

1 Like

Try this:

$$('#test').find('tbody').append( $$('<tr><td>Data</td></tr>') );
1 Like

It worked. Is this a bug or this is how it’s supposed to be?

Thanks!

It is supposed to be in Dom7