Skip to content

Commit a8d50df

Browse files
committed
Widget: Give example of getting all elements that are instances of the widget.
1 parent da3fe63 commit a8d50df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

entries/jQuery.widget.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
<h3>Instance</h3>
8989

90-
<p>The widget's instance is stored using jQuery core's <a href="http://api.jquery.com/jQuery.data/">data method</a> with the widget's full name as the key. Therefore, you can use the following to retrieve the progressbar widget's instance object from the element.</p>
90+
<p>The widget's instance is stored using <a href="http://api.jquery.com/jQuery.data/"><code>jQuery.data()</code></a> with the widget's full name as the key. Therefore, you can use the following to retrieve the progressbar widget's instance object from the element.</p>
9191

9292
<pre><code>
9393
$( "#elem" ).data( "ui-progressbar" );
@@ -99,6 +99,12 @@
9999
$( "#elem" ).is( ":data( 'ui-progressbar' )" ); // true
100100
$( "#elem" ).is( ":data( 'ui-draggable' )" ); //false
101101
</code></pre>
102+
103+
<p>You can also use <code>:data</code> to get a list of all elements that are instances of a given widget.</p>
104+
105+
<pre><code>
106+
$( ":data( 'ui-progressbar' )" );
107+
</code></pre>
102108
</longdesc>
103109
<category slug="utilities"/>
104110
</entry>

0 commit comments

Comments
 (0)