As well all perfectly know, we can create new elements via the following code:
style: 'display: inline-block;'
A string is designated htmlString in jQuery documentation when it is used to represent one or more DOM elements, typically to be created and inserted in the document. When passed as an argument of the jQuery() function, the string is identified as HTML if it starts with ) and is parsed as such until the final > character.
So you cannot use
div as that would actually search for all existing
<div>s in your DOM.
And it also says:
When the parameter has a single tag (with optional closing tag or quick-closing) — $( "
<img />" ) or $( "
<img>" ), $( "
<a></a>" ) or $( "
There it clearly says that closing the tag is optional. So either of
<div /> are fine.