<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Prototype JavaScript framework - Element</title>
  <id>tag:prototypejs.org.,2008:mephisto/api/element</id>
  <generator uri="http://mephistoblog.com" version="0.7.3">Mephisto Noh-Varr</generator>
  <link href="http://prototypejs.org./feed/api/element/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://prototypejs.org./api/element" rel="alternate" type="text/html"/>
  <updated>2008-01-08T23:33:29Z</updated>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Mislav</name>
    </author>
    <id>tag:prototypejs.org.,2008-01-08:18685</id>
    <published>2008-01-08T23:14:00Z</published>
    <updated>2008-01-08T23:33:29Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.5.1"/>
    <link href="http://prototypejs.org./api/element/setOpacity" rel="alternate" type="text/html"/>
    <title>setOpacity</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;Element.setOpacity(element, opacity) -&gt; [HTMLElement...]
someElement.setOpacity(opacity) -&gt; [HTMLElement...]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Sets the visual opacity of an element while working around inconsistencies in various browsers. The &lt;code&gt;opacity&lt;/code&gt; argument should be a floating point number, where the value of 0 is fully transparent and 1 is fully opaque.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;Element.setOpacity(element, opacity) -&gt; [HTMLElement...]
someElement.setOpacity(opacity) -&gt; [HTMLElement...]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Sets the visual opacity of an element while working around inconsistencies in various browsers. The &lt;code&gt;opacity&lt;/code&gt; argument should be a floating point number, where the value of 0 is fully transparent and 1 is fully opaque.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/api/element/setStyle&quot;&gt;&lt;code&gt;Element.setStyle&lt;/code&gt;&lt;/a&gt; method uses &lt;code&gt;setOpacity&lt;/code&gt; internally when needed.&lt;/p&gt;

&lt;h3&gt;Examples&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;var element = $('myelement');
// set to 50% transparency
element.setOpacity(0.5);

// these are equivalent, but allow for setting more than
// one CSS property at once:
element.setStyle({ opacity: 0.5 });
element.setStyle(&quot;opacity: 0.5&quot;);
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Andrew</name>
    </author>
    <id>tag:prototypejs.org.,2007-12-05:18126</id>
    <published>2007-12-05T01:30:00Z</published>
    <updated>2007-12-05T01:36:45Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/adjacent" rel="alternate" type="text/html"/>
    <title>adjacent</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;Element.adjacent(element[, selectors...]) -&gt; [HTMLElement...]
someElement.adjacent([selectors...]) -&gt; [HTMLElement...]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finds all siblings of the current element that match the given selector(s).&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;Element.adjacent(element[, selectors...]) -&gt; [HTMLElement...]
someElement.adjacent([selectors...]) -&gt; [HTMLElement...]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finds all siblings of the current element that match the given selector(s).&lt;/p&gt;
&lt;h3&gt;Examples&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;ul id=&amp;quot;cities&amp;quot;&amp;gt;
    &amp;lt;li class=&amp;quot;us&amp;quot; id=&amp;quot;nyc&amp;quot;&amp;gt;New York&amp;lt;/li&amp;gt;
    &amp;lt;li class=&amp;quot;uk&amp;quot; id=&amp;quot;lon&amp;quot;&amp;gt;London&amp;lt;/li&amp;gt;
    &amp;lt;li class=&amp;quot;us&amp;quot; id=&amp;quot;chi&amp;quot;&amp;gt;Chicago&amp;lt;/li&amp;gt;
    &amp;lt;li class=&amp;quot;jp&amp;quot; id=&amp;quot;tok&amp;quot;&amp;gt;Tokyo&amp;lt;/li&amp;gt;
    &amp;lt;li class=&amp;quot;us&amp;quot; id=&amp;quot;la&amp;quot;&amp;gt;Los Angeles&amp;lt;/li&amp;gt;
    &amp;lt;li class=&amp;quot;us&amp;quot; id=&amp;quot;aus&amp;quot;&amp;gt;Austin&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;$('nyc').adjacent('li.us');
//-&gt; [&amp;lt;li#chi, li#la, li#aus&amp;gt;]
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Andrew</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-27:18043</id>
    <published>2007-11-27T20:18:00Z</published>
    <updated>2008-01-25T23:29:34Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/wrap" rel="alternate" type="text/html"/>
    <title>wrap</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;Element.wrap(element, wrapper[, attributes]) -&gt; HTMLElement
someElement.wrap(wrapper[, attributes]) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Wraps an element inside another, then returns the wrapper.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;Element.wrap(element, wrapper[, attributes]) -&gt; HTMLElement
someElement.wrap(wrapper[, attributes]) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Wraps an element inside another, then returns the wrapper.&lt;/p&gt;
&lt;p class=&quot;notice&quot;&gt;Using &lt;code&gt;wrap&lt;/code&gt; as an instance method (e.g., &lt;code&gt;$('foo').wrap('p')&lt;/code&gt;) causes errors in Internet Explorer when used on &lt;code&gt;textarea&lt;/code&gt; elements. The &lt;code&gt;wrap&lt;/code&gt; property is reserved on &lt;code&gt;textarea&lt;/code&gt;s as a proprietary extension to HTML. As a workaround, use the generic version instead (&lt;code&gt;Element.wrap('foo', 'p')&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;If the given element exists on the page, &lt;code&gt;Element#wrap&lt;/code&gt; will wrap it in place — its position will remain the same.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;wrapper&lt;/code&gt; argument can be &lt;em&gt;either&lt;/em&gt; an existing &lt;code&gt;HTMLElement&lt;/code&gt; &lt;em&gt;or&lt;/em&gt; a string representing the tag name of an element to be created. The optional &lt;code&gt;attributes&lt;/code&gt; argument can contain a list of attribute/value pairs that will be set on the wrapper using &lt;a href=&quot;/api/element/writeAttribute&quot;&gt;&lt;code&gt;Element#writeAttribute&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Examples&lt;/h3&gt;

&lt;h4&gt;Original HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;table id=&amp;quot;data&amp;quot;&amp;gt;
  &amp;lt;tr&amp;gt;
    &amp;lt;th&amp;gt;Foo&amp;lt;/th&amp;gt;
    &amp;lt;th&amp;gt;Bar&amp;lt;/th&amp;gt;
  &amp;lt;/tr&amp;gt;
  &amp;lt;tr&amp;gt;
    &amp;lt;td&amp;gt;1&amp;lt;/td&amp;gt;
    &amp;lt;td&amp;gt;2&amp;lt;/td&amp;gt;
  &amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;JavaScript&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;// approach 1:
var div = new Element('div', { 'class': 'table-wrapper' });
$('data').wrap(div);

// approach 2:
$('data').wrap('div', { 'class': 'table-wrapper' });

// examples are equivalent. both return the DIV.
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Resulting HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;div class=&amp;quot;table-wrapper&amp;quot;&amp;gt;
  &amp;lt;table id=&amp;quot;data&amp;quot;&amp;gt;
    &amp;lt;tr&amp;gt;
      &amp;lt;th&amp;gt;Foo&amp;lt;/th&amp;gt;
      &amp;lt;th&amp;gt;Bar&amp;lt;/th&amp;gt;
    &amp;lt;/tr&amp;gt;
    &amp;lt;tr&amp;gt;
      &amp;lt;td&amp;gt;1&amp;lt;/td&amp;gt;
      &amp;lt;td&amp;gt;2&amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-08:17812</id>
    <published>2007-11-08T01:04:00Z</published>
    <updated>2007-11-08T01:06:41Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/viewportoffset" rel="alternate" type="text/html"/>
    <title>viewportOffset</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;viewportOffset(element) -&gt; [Number, Number] also accessible as { left: Number, top: Number }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Returns the X/Y coordinates of &lt;code&gt;element&lt;/code&gt; relative to the &lt;em&gt;viewport&lt;/em&gt;.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;viewportOffset(element) -&gt; [Number, Number] also accessible as { left: Number, top: Number }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Returns the X/Y coordinates of &lt;code&gt;element&lt;/code&gt; relative to the &lt;em&gt;viewport&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Note that all values are returned as &lt;em&gt;numbers only&lt;/em&gt; although they are &lt;em&gt;expressed in pixels&lt;/em&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-08:17811</id>
    <published>2007-11-08T01:01:00Z</published>
    <updated>2007-11-08T01:02:15Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/getoffsetparent" rel="alternate" type="text/html"/>
    <title>getOffsetParent</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;getOffsetParent(element) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Returns &lt;code&gt;element&lt;/code&gt;&#8217;s closest &lt;em&gt;positioned&lt;/em&gt; ancestor. If none is found, the &lt;code&gt;body&lt;/code&gt; element is returned.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;getOffsetParent(element) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Returns &lt;code&gt;element&lt;/code&gt;&#8217;s closest &lt;em&gt;positioned&lt;/em&gt; ancestor. If none is found, the &lt;code&gt;body&lt;/code&gt; element is returned.&lt;/p&gt;
&lt;p&gt;The returned element is &lt;code&gt;element&lt;/code&gt;&#8217;s &lt;a href=&quot;http://www.w3.org/TR/CSS21/visudet.html#containing-block-details&quot;&gt;CSS containing block&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-08:17809</id>
    <published>2007-11-08T00:54:00Z</published>
    <updated>2007-11-08T01:00:03Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/positionedoffset" rel="alternate" type="text/html"/>
    <title>positionedOffset</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;positionedOffset(element) -&gt; [Number, Number] also accessible as { left: Number, top: Number }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Returns &lt;code&gt;element&lt;/code&gt;&#8217;s offset relative to its closest positioned ancestor (the element that would be returned by &lt;a href=&quot;/api/api/getoffsetparent&quot;&gt;Element#getOffsetParent&lt;/a&gt;).&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;positionedOffset(element) -&gt; [Number, Number] also accessible as { left: Number, top: Number }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Returns &lt;code&gt;element&lt;/code&gt;&#8217;s offset relative to its closest positioned ancestor (the element that would be returned by &lt;a href=&quot;/api/api/getoffsetparent&quot;&gt;Element#getOffsetParent&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Calculates the cumulative &lt;code&gt;offsetLeft&lt;/code&gt; and &lt;code&gt;offsetTop&lt;/code&gt; of an element and all its parents &lt;em&gt;until&lt;/em&gt; it reaches an element with a position of &lt;code&gt;static&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Note that all values are returned as &lt;em&gt;numbers only&lt;/em&gt; although they are &lt;em&gt;expressed in pixels&lt;/em&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-08:17808</id>
    <published>2007-11-08T00:50:00Z</published>
    <updated>2007-11-08T00:53:28Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/cumulativescrolloffset" rel="alternate" type="text/html"/>
    <title>cumulativeScrollOffset</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;cumulativeScrollOffset(element) -&gt; [Number, Number] also accessible as { left: Number, top: Number }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Calculates the cumulative scroll offset of an element in nested scrolling containers.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;cumulativeScrollOffset(element) -&gt; [Number, Number] also accessible as { left: Number, top: Number }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Calculates the cumulative scroll offset of an element in nested scrolling containers.&lt;/p&gt;
&lt;p&gt;Adds the cumulative &lt;code&gt;scrollLeft&lt;/code&gt; and &lt;code&gt;scrollTop&lt;/code&gt; of an element and all its parents.&lt;/p&gt;

&lt;p&gt;Used for calculating the scroll offset of an element that is in more than one scroll container (e.g., a draggable in a scrolling container which is itself part of a scrolling document).&lt;/p&gt;

&lt;p&gt;Note that all values are returned as &lt;em&gt;numbers only&lt;/em&gt; although they are &lt;em&gt;expressed in pixels&lt;/em&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-08:17807</id>
    <published>2007-11-08T00:41:00Z</published>
    <updated>2007-11-08T00:48:45Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/cumulativeoffset" rel="alternate" type="text/html"/>
    <title>cumulativeOffset</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;cumulativeOffset(element) -&gt; [Number, Number] also accessible as { left: Number, top: Number }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Returns the offsets of &lt;code&gt;element&lt;/code&gt; from the top left corner of the document.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;cumulativeOffset(element) -&gt; [Number, Number] also accessible as { left: Number, top: Number }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Returns the offsets of &lt;code&gt;element&lt;/code&gt; from the top left corner of the document.&lt;/p&gt;
&lt;p&gt;Adds the cumulative &lt;code&gt;offsetLeft&lt;/code&gt; and &lt;code&gt;offsetTop&lt;/code&gt; of an element and all its parents.&lt;/p&gt;

&lt;p&gt;Note that all values are returned as &lt;em&gt;numbers only&lt;/em&gt; although they are &lt;em&gt;expressed in pixels&lt;/em&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-07:17801</id>
    <published>2007-11-07T20:42:00Z</published>
    <updated>2007-11-07T20:50:18Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/cloneposition" rel="alternate" type="text/html"/>
    <title>clonePosition</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;clonePosition(element, source[, options]) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Clones the position and/or dimensions of &lt;code&gt;source&lt;/code&gt; onto &lt;code&gt;element&lt;/code&gt; as defined by the optional argument &lt;code&gt;options&lt;/code&gt;. &lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;clonePosition(element, source[, options]) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Clones the position and/or dimensions of &lt;code&gt;source&lt;/code&gt; onto &lt;code&gt;element&lt;/code&gt; as defined by the optional argument &lt;code&gt;options&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;Note that &lt;code&gt;target&lt;/code&gt; will be positioned exactly like &lt;code&gt;source&lt;/code&gt; whether or not it is part of the same &lt;a href=&quot;http://www.w3.org/TR/CSS21/visudet.html#containing-block-details&quot;&gt;CSS containing block&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Options&lt;/h3&gt;

&lt;table&gt;
&lt;thead&gt;
  &lt;tr&gt;
    &lt;th&gt;Name&lt;/th&gt;
    &lt;th&gt;Default&lt;/th&gt;
    &lt;th&gt;Description&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;code&gt;setLeft&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;clones &lt;code&gt;source&lt;/code&gt;&#8217;s &lt;code&gt;left&lt;/code&gt; CSS property onto &lt;code&gt;element&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;&lt;code&gt;setTop&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;clones &lt;code&gt;source&lt;/code&gt;&#8217;s &lt;code&gt;top&lt;/code&gt; CSS property onto &lt;code&gt;element&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;&lt;code&gt;setWidth&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;clones &lt;code&gt;source&lt;/code&gt;&#8217;s &lt;code&gt;width&lt;/code&gt; onto &lt;code&gt;element&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;&lt;code&gt;setHeight&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;clones &lt;code&gt;source&lt;/code&gt;&#8217;s &lt;code&gt;width&lt;/code&gt; onto &lt;code&gt;element&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;&lt;code&gt;offsetLeft&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;Number by which to offset &lt;code&gt;element&lt;/code&gt;&#8217;s &lt;code&gt;left&lt;/code&gt; CSS property.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;&lt;code&gt;offsetTop&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
  &lt;td&gt;Number by which to offset &lt;code&gt;element&lt;/code&gt;&#8217;s &lt;code&gt;top&lt;/code&gt; CSS property.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-07:17798</id>
    <published>2007-11-07T20:38:00Z</published>
    <updated>2007-11-07T21:00:15Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/relativize" rel="alternate" type="text/html"/>
    <title>relativize</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;relativize(element) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Turns &lt;code&gt;element&lt;/code&gt; into an relatively-positioned element &lt;em&gt;without&lt;/em&gt; changing its position in the page layout.&lt;/p&gt;</summary>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-07:17797</id>
    <published>2007-11-07T20:31:00Z</published>
    <updated>2007-11-07T20:59:51Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/absolutize" rel="alternate" type="text/html"/>
    <title>absolutize</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;absolutize(element) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Turns &lt;code&gt;element&lt;/code&gt; into an absolutely-positioned element &lt;em&gt;without&lt;/em&gt; changing its position in the page layout.&lt;/p&gt;</summary>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-06:17778</id>
    <published>2007-11-06T13:26:00Z</published>
    <updated>2007-11-06T13:30:09Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/select" rel="alternate" type="text/html"/>
    <title>select</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;select(element, selector...) -&gt; [HTMLElement...]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Takes an arbitrary number of CSS selectors (strings) and returns an array of &lt;a href=&quot;/api/element/extend&quot;&gt;extended&lt;/a&gt; descendants of &lt;code&gt;element&lt;/code&gt; that match any of them.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;select(element, selector...) -&gt; [HTMLElement...]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Takes an arbitrary number of CSS selectors (strings) and returns an array of &lt;a href=&quot;/api/element/extend&quot;&gt;extended&lt;/a&gt; descendants of &lt;code&gt;element&lt;/code&gt; that match any of them.&lt;/p&gt;
&lt;p&gt;This method is very similar to &lt;a href=&quot;/api/utility/dollar-dollar&quot;&gt;$$()&lt;/a&gt; but can be used within the context of one element, rather than the whole document. The supported CSS syntax is identical, so please refer to the &lt;a href=&quot;/api/utility/dollar-dollar&quot;&gt;&lt;code&gt;$$()&lt;/code&gt; docs&lt;/a&gt; for details.&lt;/p&gt;

&lt;h3&gt;Examples&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&amp;lt;ul id=&quot;fruits&quot;&amp;gt;
  &amp;lt;li id=&quot;apples&quot;&amp;gt;
    &amp;lt;h3 title=&quot;yummy!&quot;&amp;gt;Apples&amp;lt;/h3&amp;gt;
    &amp;lt;ul id=&quot;list-of-apples&quot;&amp;gt;
      &amp;lt;li id=&quot;golden-delicious&quot; title=&quot;yummy!&quot; &amp;gt;Golden Delicious&amp;lt;/li&amp;gt;
      &amp;lt;li id=&quot;mutsu&quot; title=&quot;yummy!&quot;&amp;gt;Mutsu&amp;lt;/li&amp;gt;
      &amp;lt;li id=&quot;mcintosh&quot;&amp;gt;McIntosh&amp;lt;/li&amp;gt;
      &amp;lt;li id=&quot;ida-red&quot;&amp;gt;Ida Red&amp;lt;/li&amp;gt;
    &amp;lt;/ul&amp;gt;
    &amp;lt;p id=&quot;saying&quot;&amp;gt;An apple a day keeps the doctor away.&amp;lt;/p&amp;gt;  
  &amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;$('apples').select('[title=&quot;yummy!&quot;]');
// -&gt; [h3, li#golden-delicious, li#mutsu]

$('apples').select( 'p#saying', 'li[title=&quot;yummy!&quot;]');
// -&gt; [li#golden-delicious, li#mutsu,  p#saying]

$('apples').select('[title=&quot;disgusting!&quot;]');
// -&gt; []&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Tip&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Element#select&lt;/code&gt; can be used as a pleasant alternative to the native method &lt;code&gt;getElementsByTagName&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;var nodes  = $A(someUL.getElementsByTagName('li')).map(Element.extend);
var nodes2 = someUL.select('li');&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In the first example, you must explicitly convert the result set to an &lt;code&gt;Array&lt;/code&gt; (so that Prototype&#8217;s &lt;a href=&quot;/api/enumerable&quot;&gt;&lt;code&gt;Enumerable&lt;/code&gt;&lt;/a&gt; methods can be used) and must manually call &lt;a href=&quot;/api/element/extend&quot;&gt;&lt;code&gt;Element.extend&lt;/code&gt;&lt;/a&gt; on each node (so that custom instance methods can be used on the nodes). &lt;code&gt;Element#select&lt;/code&gt; takes care of both concerns on its own.&lt;/p&gt;

&lt;p&gt;If you&#8217;re using 1.6 or above (and the performance optimizations therein), the speed difference between these two examples is negligible.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-06:17777</id>
    <published>2007-11-06T12:59:00Z</published>
    <updated>2007-11-06T13:09:04Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/identify" rel="alternate" type="text/html"/>
    <title>identify</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;identify(element) -&gt; id&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;returns &lt;code&gt;element&lt;/code&gt;&#8217;s &lt;code&gt;id&lt;/code&gt; attribute if it exists, or sets and returns a unique, auto-generated &lt;code&gt;id&lt;/code&gt;.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;identify(element) -&gt; id&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;returns &lt;code&gt;element&lt;/code&gt;&#8217;s &lt;code&gt;id&lt;/code&gt; attribute if it exists, or sets and returns a unique, auto-generated &lt;code&gt;id&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Examples&lt;/h3&gt;

&lt;h4&gt;Original HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;ul&amp;gt;
    &amp;lt;li id=&amp;quot;apple&amp;quot;&amp;gt;apple&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;orange&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;JavaScript&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
  $('apple').identify();
  // -&gt; 'apple'

  $('apple').next().identify();
  // -&gt; 'anonymous_element_1'
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;resulting HTML&lt;/h4&gt;

&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
  &amp;lt;ul&amp;gt;
    &amp;lt;li id=&amp;quot;apple&amp;quot;&amp;gt;apple&amp;lt;/li&amp;gt;
    &amp;lt;li id=&amp;quot;anonymous_element_1&amp;quot;&amp;gt;orange&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Tobie</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-06:17776</id>
    <published>2007-11-06T12:40:00Z</published>
    <updated>2007-11-08T01:09:39Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6"/>
    <link href="http://prototypejs.org./api/element/insert" rel="alternate" type="text/html"/>
    <title>insert</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;insert(element, { position: content }) -&gt; HTMLElement
insert(element, content) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts &lt;code&gt;content&lt;/code&gt; before, after, at the top of, or at the bottom of &lt;code&gt;element&lt;/code&gt;, as specified by the &lt;code&gt;position&lt;/code&gt; property of the second argument. If the second argument is the content itself, &lt;code&gt;insert&lt;/code&gt; will append it to &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;insert(element, { position: content }) -&gt; HTMLElement
insert(element, content) -&gt; HTMLElement&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Inserts &lt;code&gt;content&lt;/code&gt; before, after, at the top of, or at the bottom of &lt;code&gt;element&lt;/code&gt;, as specified by the &lt;code&gt;position&lt;/code&gt; property of the second argument. If the second argument is the content itself, &lt;code&gt;insert&lt;/code&gt; will append it to &lt;code&gt;element&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;insert&lt;/code&gt; accepts the following kind of content: text, HTML, DOM element, and any kind of object with a &lt;code&gt;toHTML&lt;/code&gt; or &lt;code&gt;toElement&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;Note that if the inserted HTML contains any &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag, these will be automatically evaluated after the insertion (&lt;code&gt;insert&lt;/code&gt; internally calls &lt;a href=&quot;/api/string/evalScripts&quot;&gt;String#evalScripts&lt;/a&gt; when inserting HTML). &lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://prototypejs.org./">
    <author>
      <name>Andrew</name>
    </author>
    <id>tag:prototypejs.org.,2007-11-06:17763</id>
    <published>2007-11-06T02:40:00Z</published>
    <updated>2008-02-19T13:02:25Z</updated>
    <category term="Element"/>
    <category term="Element.Methods"/>
    <category term="1.6.0"/>
    <link href="http://prototypejs.org./api/element/fire" rel="alternate" type="text/html"/>
    <title>fire</title>
<summary type="html">&lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;fire(eventName[, memo]) -&gt; Event&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Fires a custom event with the current element as its target.&lt;/p&gt;</summary><content type="html">
            &lt;pre&gt;&lt;code class=&quot;ebnf&quot;&gt;fire(eventName[, memo]) -&gt; Event&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Fires a custom event with the current element as its target.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Element#fire&lt;/code&gt; creates a custom event with the given name, then triggers it on the given element. The custom event has all the same properties and methods of native events. Like a native event, it will bubble up through the DOM unless its propagation is explicitly stopped.&lt;/p&gt;

&lt;p&gt;The optional second argument will be assigned to the &lt;code&gt;memo&lt;/code&gt; property of the event object so that it can be read by event handlers.&lt;/p&gt;

&lt;p&gt;Custom events are dispatched synchronously: &lt;code&gt;Element#fire&lt;/code&gt; waits until the event finishes its life cycle, then returns the event itself.&lt;/p&gt;

&lt;h3&gt;Note&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Element#fire&lt;/code&gt; does not support firing native events. All custom event names &lt;em&gt;must&lt;/em&gt; be namespaced (using a colon). This is to avoid custom event names conflicting with non-standard native DOM events such as &lt;code&gt;mousewheel&lt;/code&gt; and &lt;code&gt;DOMMouseScroll&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;Examples&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;document.observe(&quot;widget:frobbed&quot;, function(event) {
  console.log(&quot;Element with ID (&quot; + event.target.id +
   &quot;) frobbed widget #&quot; + event.memo.widgetNumber + &quot;.&quot;);
});

var someNode = $('foo');
someNode.fire(&quot;widget:frobbed&quot;, { widgetNumber: 19 });

//-&gt; &quot;Element with ID (foo) frobbed widget #19.&quot;&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Tip&lt;/h3&gt;

&lt;p&gt;Events that have been stopped with &lt;code&gt;Event#stop&lt;/code&gt; will have a boolean &lt;code&gt;stopped&lt;/code&gt; property set to true. Since &lt;code&gt;Element#fire&lt;/code&gt; returns the custom event, you can inspect this property to determine whether the event was stopped.&lt;/p&gt;
          </content>  </entry>
</feed>
