Skip to content

Commit

Permalink
jQuery: Add a self-closed tag back to an example
Browse files Browse the repository at this point in the history
This adds an actual quick-closed tag in this code example, as it is implied by the text that there can be one:

> Tags that cannot contain elements may be quick-closed or not:
> ```js
> $( "<img>" );
> $( "<input>" );
> ```

to:

> Tags that cannot contain elements may be quick-closed or not:
> ```js
> $( "<img />" );
> $( "<input>" );
> ```

Closes gh-1264
  • Loading branch information
flinti authored Oct 20, 2024
1 parent ed882c0 commit a9c3f49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entries/jQuery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ $( myForm.elements ).hide();
<pre><code>$( "&lt;a href='https://jquery.com'&gt;&lt;/a&gt;" );</code></pre>
<p>Tags that cannot contain elements may be quick-closed or not:</p>
<pre><code>
$( "&lt;img&gt;" );
$( "&lt;img /&gt;" );
$( "&lt;input&gt;" );
</code></pre>
<p>When passing HTML to <code>jQuery()</code>, note that text nodes are not treated as DOM elements. With the exception of a few methods (such as <code>.content()</code>), they are generally ignored or removed. E.g:</p>
Expand Down

0 comments on commit a9c3f49

Please sign in to comment.