Jax-p Jax-p - 1 year ago 84
jQuery Question

How to appendChild() on Jquery selected DOM

I am trying to append child via jQuery to the on of selected HTML element.

My code:

var table = $(this).parent();


[table.table.unit-list, prevObject: jQuery.fn.init[1], context: tr] //log
... appendChild is not a function //error

Answer Source

Just use .append()

Description: Insert content, specified by the parameter, to the end of each element in the set of matched elements.


Read about Difference between append and appendChild

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download