I am trying to append two HTML elements and pass it to the after() function in jquery:
$('div.masterButtons').after(function () {
var foobar = $('<div>foo<div>bar</div></div>');
var foobaz = $('<div>foo<div>baz</div></div>');
return (foobar + foobaz)
}
);
It prints:
[object Object][object Object]
How do I append the two elements? I am avoiding concatenating two html strings because the divs are far more complicated than these and I would need jquery elements to build it.