Skip to content

Commit 81de7ca

Browse files
committed
Expand on the definition of the htmlString type.
1 parent 30cece8 commit 81de7ca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pages/Types.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ <h3 id="Boolean_Default"> Boolean Default </h3>
137137
</code></pre>
138138

139139
<h2 id="htmlString"> htmlString </h2>
140-
<p>A string is designated <strong>htmlString</strong> 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 <code>jQuery()</code> function, the string is identified as HTML if it starts with <code>&lt;tag ... &gt;</code>) and is parsed as such until the final <code>&gt;</code> character. </p>
140+
<p>A string is designated <strong>htmlString</strong> 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 <code>jQuery()</code> function, the string is identified as HTML if it starts with <code>&lt;tag ... &gt;</code>) and is parsed as such until the final <code>&gt;</code> character. Prior to jQuery 1.9, a string was considered to be HTML if it contained <code>&lt;tag ... &gt;</code> <em>anywhere within the string</em>.</p>
141+
<p>When a string as passed as an argument to a manipulation method such as <code>.append()</code>, it is always considered to be HTML since jQuery's other common interpretation of a string (CSS selectors) does not apply in those contexts.</p>
141142
<p>For explicit parsing of a string to HTML, the <code><a href="/jQuery.parseHTML/">$.parseHTML()</a></code> method is available as of jQuery 1.8.</p>
142143
<pre><code data-lang="javascript">// Appends <b>hello</b>:
143144
$( "<b>hello</b>" ).appendTo( "body" );

0 commit comments

Comments
 (0)