Skip to content

Commit 509a392

Browse files
committed
Fix jquery#54. Warn in 1st example that using bare universal selector may select elements added by browser extensions.
1 parent 7970a0e commit 509a392

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

entries/all-selector.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<p>Caution: The all, or universal, selector is extremely slow, except when used by itself.</p>
1111
</longdesc>
1212
<example>
13-
<desc>Finds every element (including head, body, etc) in the document.</desc>
13+
<desc>Find every element (including head, body, etc) in the document. Note that if your browser has an extension/add-on enabled that inserts a <code>&lt;script&gt;</code> or <code>&lt;link&gt;</code> element into the DOM, that element will be counted as well.</desc>
1414
<code><![CDATA[var elementCount = $("*").css("border","3px solid red").length;
1515
$("body").prepend("<h3>" + elementCount + " elements found</h3>");]]></code>
1616
<html><![CDATA[<div>DIV</div>
@@ -30,7 +30,7 @@ $("body").prepend("<h3>" + elementCount + " elements found</h3>");]]></code>
3030
]]></css>
3131
</example>
3232
<example>
33-
<desc>A common way to select all elements is to find within document.body so elements like head, script, etc are left out.</desc>
33+
<desc>Find all elements within document.body so elements like head, script, etc. are excluded.</desc>
3434
<code><![CDATA[
3535
var elementCount = $("#test").find("*").css("border","3px solid red").length;
3636
$("body").prepend("<h3>" + elementCount + " elements found</h3>");]]></code>
@@ -56,4 +56,4 @@ $("body").prepend("<h3>" + elementCount + " elements found</h3>");]]></code>
5656
</example>
5757
<category slug="selectors/basic-css-selectors"/>
5858
<category slug="version/1.0"/>
59-
</entry>
59+
</entry>

0 commit comments

Comments
 (0)