jQuery has an .after()
method, and also an .insertAfter()
method.
What\'s the difference between them? I think I can use .after()
It also seems that passing attributes of the inserted element doesn't work with ".insertAfter", but works with ".after"
works:
$('#element').after('Test
', { 'class': 'element_class', 'id': 'element_id' });
doesn't work:
$('Test
', { 'class': 'element_class', 'id': 'element_id' }).insertAfter('#element');
*edit: seems it doesn't work with ".after" neither, but only with ".appendTo"