I am pretty new in jQuery. I cam across this jQuery code that uses <div />
as a selector:
$("<div />").html(someString).text();
First of all, I would like to know if it is a legitimate tag to use, since div
has an end tag: </div>
.
But my main question - does jQuery can use an end tag as a selector and what would be the result of such code?
What will do such code? I did some research, and here, meagar say:
There is no such thing as a "closing tag" in the DOM. Tags, closing or otherwise, are a component of your markup, the DOM has only elements.
but does jQuery treat an end tag as reference to a DOM element like it treats an opening tag?
Thank you very much.