Wikipedia:User scripts/Guide: Difference between revisions

Content deleted Content added
Finding elements: Updated example to use jQuery
Finding elements: capitialization
Line 172:
</source>
 
weWe can «find» element <tt>textarea</tt>:
* usingUsing its <tt>id</tt>: <code>$( '#txtid' )</code>
* inIn the array of all elements with the same <tt>tag</tt>: <code>$( 'textarea' )</code>
* usingUsing element next to it: <code>$( '#neighbor').prev()</code>
* asAs a child of its parent: <code>$( '#frmid' ).children( 'form' )</code>
* asAs a form element, using <tt>name</tt>: <code>$( '#frmid [name="txtname"]')</code>
 
'' [http://jsfiddle.net/compwhizii/j2QRf/ This example on jsFiddle]