Wikipedia:User scripts/Guide: Difference between revisions
Content deleted Content added
Johnduhart (talk | contribs) →CSS files: Update importStylesheetURI call |
Johnduhart (talk | contribs) →Finding elements: Updated example to use jQuery |
||
Line 167:
<source lang="html4strict">
<form name="frmname" id="frmid">
<textarea name="txtname" id="txtid"></textarea>
<input id="neighbor" />
</form>
</source>
we can «find» element <tt>textarea</tt>:
* using its <tt>id</tt>: <
* in the array of all elements with the same <tt>tag</tt>: <
* using element next to it: <
* as a child of its parent: <
* as a form element, using <tt>name</tt>: <
'' [http://jsfiddle.net/compwhizii/j2QRf/ This example on jsFiddle]
The [http://docs.jquery.com/Main_Page jQuery documentation] and [http://api.jquery.com jQuery API reference] are excellent sources for documentation.
<!--To see all the elements on the page and their relations simply look at the page source code.-->
|