I saw this in jQuery tools in the tooltip script. What is <div/>
? I've never seen the backslash used that way. Probably going to get some down votes, but I must know.
The <div> tag doesn't technically do anything. It can help organize an HTML file into sections on the back end, but that won't affect how those sections display on the front end. It does, however, allow these sections to be easily styled with CSS.
The Div is the most usable tag in web development because it helps us to separate out data in the web page and we can create a particular section for particular data or function in the web pages. It is used to the group of various tags of HTML so that sections can be created and style can be applied to them.
You use the DIV tag in HTML to divide sections of an HTML document. Using the DIV tag lets you define block-level sections of an HTML document. Applying a DIV tag lets you identify the section defined by the DIV tag, so you can then apply formatting or scripting to its content.
It used to create a div
element. Its short cut to <div></div>
.
For example:
$('<div/>', {id: 'hello', 'class': 'new', html: 'New div'}).appendTo('#target');
will create div with id: hello
, class: new
with html New div
and append to #target
.
DEMO
It means "create a jQuery-wrapped div element on the fly".
When the parameter has a single tag, such as
$('<div />')
or$('<a></a>')
, jQuery creates the element using the native JavaScriptcreateElement()
function.
As result it will look like:
$(document.createElement("div"));
For detail see here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With