I have a function that takes the return value of document.createElement and puts it in a popup on the screen. However, I want this object to be passed to the popup to be an already created div so that I can manipulate the popup content easily.
Basically, I want to turn this:
var magicDiv = document.createElement('div');
Into:
var magicDiv = $('#divToBeTurnedIntoElement').html();
In the first case, document.createElement has a specific return object. I am looking for the jQuery function that returns the same kind of object as document.createElement. In both cases, magicDiv should be the exact same object, but with the jQuery version, it is created based on an existing div. How can I accomplish this?