Permalink
Browse files

Widget: Give example of getting all elements that are instances of th…

…e widget.
  • Loading branch information...
1 parent da3fe63 commit a8d50df106f117b722853a8f6ced099e56f67041 @tjvantoll tjvantoll committed Feb 20, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 entries/jQuery.widget.xml
@@ -87,7 +87,7 @@
<h3>Instance</h3>
- <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>
+ <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>
<pre><code>
$( "#elem" ).data( "ui-progressbar" );
@@ -99,6 +99,12 @@
$( "#elem" ).is( ":data( 'ui-progressbar' )" ); // true
$( "#elem" ).is( ":data( 'ui-draggable' )" ); //false
</code></pre>
+
+ <p>You can also use <code>:data</code> to get a list of all elements that are instances of a given widget.</p>
+
+ <pre><code>
+ $( ":data( 'ui-progressbar' )" );
+ </code></pre>
</longdesc>
<category slug="utilities"/>
</entry>

0 comments on commit a8d50df

Please sign in to comment.