Skip to content

Commit 912b852

Browse files
committed
removeProp: clarify recommendations regarding native properties
Ref jquery/jquery#4887 Close jquerygh-1189
1 parent a3af063 commit 912b852

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

entries/removeProp.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<desc>Remove a property for the set of matched elements.</desc>
1111
<longdesc>
1212
<p>The <code>.removeProp()</code> method removes properties set by the <code><a href="/prop/">.prop()</a></code> method.</p>
13-
<p>With some built-in properties of a DOM element or <code>window</code> object, browsers may generate an error if an attempt is made to remove the property. jQuery first assigns the value <code>undefined</code> to the property and ignores any error the browser generates. In general, it is only necessary to remove custom properties that have been set on an object, and not built-in (native) properties.</p>
14-
<p><strong>Note:</strong> Do not use this method to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use <code><a href="/prop/">.prop()</a></code> to set these properties to <code>false</code> instead.</p>
13+
<p><strong>Note:</strong>This method should not be used to remove built-in (native) properties such as "checked", "disabled", "selected", or others. This can lead to unexpected behavior.</p>
14+
<p>It's almost always better to use <code><a href="/prop/">.prop()</a></code> to set native properties to <code>false</code> instead of removing them.</p>
1515
</longdesc>
1616
<note id="prop-memory-leaks" type="additional"/>
1717
<example>

0 commit comments

Comments
 (0)