Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
removeProp: clarify recommendations regarding native properties
  • Loading branch information
timmywil committed May 14, 2021
commit 8107238c6afed15954a05e2f3194c243830b559f
4 changes: 2 additions & 2 deletions entries/removeProp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<desc>Remove a property for the set of matched elements.</desc>
<longdesc>
<p>The <code>.removeProp()</code> method removes properties set by the <code><a href="/prop/">.prop()</a></code> method.</p>
<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>
<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>
<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>
<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>
</longdesc>
<note id="prop-memory-leaks" type="additional"/>
<example>
Expand Down