You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: entries/jQuery.hasData.xml
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
</signature>
10
10
<desc>Determine whether an element has any jQuery data associated with it.</desc>
11
11
<longdesc>
12
-
<p>The <code>jQuery.hasData()</code> method provides a way to determine if an element currently has any values that were set using <code><ahref="/jQuery.data/">jQuery.data()</a></code>. If no data is associated with an element (there is no data object at all or the data object is empty), the method returns <code>false</code>; otherwise it returns <code>true</code>.</p>
12
+
<p>The <code>jQuery.hasData()</code> method provides a way to determine if an element currently has any values that were set using <code><ahref="/jQuery.data/">jQuery.data()</a></code>. If there is no data object associated with an element, the method returns <code>false</code>; otherwise it returns <code>true</code>.</p>
13
13
<p>The primary advantage of <code>jQuery.hasData(element)</code> is that it does not create and associate a data object with the element if none currently exists. In contrast, <code>jQuery.data(element)</code> always returns a data object to the caller, creating one if no data object previously existed.
14
14
</p>
15
15
<p>Note that jQuery's event system uses the jQuery data API to store event handlers. Therefore, binding an event to an element using <code>.on()</code>, <code>.bind()</code>, <code>.live()</code>, <code>.delegate()</code>, or one of the shorthand event methods also associates a data object with that element.
0 commit comments