From 7e945c5599bcc07a8ad38dc69ef773dbbec54916 Mon Sep 17 00:00:00 2001 From: Flinti Date: Sat, 19 Oct 2024 17:16:56 +0200 Subject: [PATCH] jQuery(): Add explicit quick-closed tag example for `jQuery( html [, ownerDocument ] )` --- entries/jQuery.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entries/jQuery.xml b/entries/jQuery.xml index 921ca1a9..398f10b4 100644 --- a/entries/jQuery.xml +++ b/entries/jQuery.xml @@ -183,7 +183,7 @@ $( myForm.elements ).hide();
$( "<a href='https://jquery.com'></a>" );

Tags that cannot contain elements may be quick-closed or not:


-$( "<img>" );
+$( "<img />" );
 $( "<input>" );
       

When passing HTML to jQuery(), note that text nodes are not treated as DOM elements. With the exception of a few methods (such as .content()), they are generally ignored or removed. E.g: