<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='docs.xsl'?>
<docs>
<method cat='Core' type='jQuery' short='Execute a function within the context of every matched element.' name='each'>
<desc>Execute a function within the context of every matched element.
This means that every time the passed-in function is executed
(which is once for every element matched) the 'this' keyword
points to the specific DOM element.

Additionally, the function, when executed, is passed a single
argument representing the position of the element in the matched
set (integer, zero-index).</desc>
<params type='Function' name='fn'>
<desc>A function to execute</desc>
</params>
<examples>
<desc>Iterates over two images and sets their src property</desc>
<before>&lt;img/&gt;&lt;img/&gt;</before>
<code>$("img").each(function(i){
  this.src = "test" + i + ".jpg";
});</code>
<result>&lt;img src="test0.jpg"/&gt;&lt;img src="test1.jpg"/&gt;</result>
</examples>
</method></docs>
