This may be a simple answer, but I'm trying to add a dom-created element (i.e. document.createElement(...)
) to a jQuery Selector.
jQuery has a great assortment of functions for adding html
- .html(htmlString)
- .append(htmlString)
- .prepend(htmlString)
But what i want to do is add a dom OBJECT
var myFancyDiv = document.createElement("div");
myFancyDiv.setAttribute("id", "FancyDiv");
// This is the theoretical function im looking for.
$("#SomeOtherDiv").htmlDom(myFancyDiv);