Create HTML elements, set attributes, add to other elements, and return an array of DOM nodes or HTML markup in a single function call