When you create an HTML object in jQuery, like you, it returns a DOM element. If you really wanted to set the HTML for your new dom element, you would need to call the innerHTML property as follows:
$myDiv.each(function () { console.log(this.innerHTML); });
For reference, here is the jQuery API for creating DOM elements: http://api.jquery.com/jQuery/#jQuery2
Also, I'm not sure why you called each function for only one element that was just created?
source share