popup =
$("<div />")
.css(settings.popupCSS)
.attr("id", settings.popupId)
.css("position", "absolute")
.appendTo("body").hide();
I’m reading some jQuery code and I’m a bit confused as to what $("<div />") means. Is it just referring to the <div /> instance that’s popping up at that moment?
Technically it doesn’t matter if you use
$('<div />')or$('<div></div>').What this code is doing is creating a new div element, adding some css styles to it, adding an id, positioning it, appending it to the body and then hiding it.
I’m guessing jQuery uses document.createElement to create the element and that means the browser knows how to render it.