When you check an item, you do not see it as it was added. Regardless of whether the elements are added as HTML code or as elements (as in this case), when you check the code you are looking for, the code created from this element, you do not look at the code that was used to add the element.
When you use $('<img />') , document.createElement('img') actually does this, so there is no HTML where the trailing slash may or may not be present. An element is created as a DOM object; it is not created from HTML code.
Thus, the reason the image does not appear is not because the tag does not have a trailing slash.
The likely reason is that the image does not actually exist where the browser is looking for it, i.e. missing file or url is invalid.
Guffa source share