<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>API: dom DOM (YUI Library)</title>
<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
<link rel="stylesheet" type="text/css" href="assets/api.css" />
<script type="text/javascript" src="assets/api-js"></script>
<script type="text/javascript" src="assets/ac-js"></script>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
<h3>dom <span class="subtitle">3.0.0</span></h3>
<a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a>
> <a href="./module_dom.html" title="dom">dom</a>
> DOM
<form onsubmit="return false">
<div id="propertysearch">
Search: <input autocomplete="off" id="searchinput" />
<div id="searchresults">
</div>
</div>
</form>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
<fieldset>
<legend>Filters</legend>
<span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
<span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
<span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
</fieldset>
</form>
<h2>
Class <b property="yui:name">DOM</b>
<span class="extends">
</span>
</h2>
<!-- class tree goes here -->
<div class="summary description" property="yui:description">
Provides DOM helper methods.
</div>
<div rel="yui:properties" resource="#properties">
</div>
<div rel="yui:methods" resource="#methods">
<div class="section method details">
<h3 id="methods">Methods</h3>
<div class="content">
<div class="private" rel="yui:method" resource="#method__bruteContains">
<h4>
<a name="method__bruteContains">_bruteContains</a></h4>
<div class="detail" >
<code>
private
Boolean
<strong property="yui:name">_bruteContains</strong>
(
element
,
needle
)
</code>
<div class="description" property="yui:description">
Brute force version of contains.
Used for browsers without contains support for non-HTMLElement Nodes (textNodes, etc).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The containing html element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">needle</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The html element that may be contained.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Boolean
</code></dt>
<dd property="yui:returnInfo">Whether or not the element is or contains the needle.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private" rel="yui:method" resource="#method__getDoc">
<h4>
<a name="method__getDoc">_getDoc</a></h4>
<div class="detail" >
<code>
private
Object
<strong property="yui:name">_getDoc</strong>
(
element
)
</code>
<div class="description" property="yui:description">
returns the appropriate document.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> optional Target element.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Object
</code></dt>
<dd property="yui:returnInfo">The document for the given element or the default document.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private" rel="yui:method" resource="#method__getRegExp">
<h4>
<a name="method__getRegExp">_getRegExp</a></h4>
<div class="detail" >
<code>
private
RegExp
<strong property="yui:name">_getRegExp</strong>
(
str
,
flags
)
</code>
<div class="description" property="yui:description">
Memoizes dynamic regular expressions to boost runtime performance.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">str</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The string to convert to a regular expression.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">flags</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> optional An optinal string of flags.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
RegExp
</code></dt>
<dd property="yui:returnInfo">An instance of RegExp</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private" rel="yui:method" resource="#method__getWin">
<h4>
<a name="method__getWin">_getWin</a></h4>
<div class="detail" >
<code>
private
Object
<strong property="yui:name">_getWin</strong>
(
element
)
</code>
<div class="description" property="yui:description">
returns the appropriate window.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> optional Target element.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Object
</code></dt>
<dd property="yui:returnInfo">The window for the given element or the default window.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_addClass">
<h4>
<a name="method_addClass">addClass</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">addClass</strong>
(
element
,
className
)
</code>
<div class="description" property="yui:description">
Adds a class name to a given DOM element.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The DOM element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">className</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> the class name to add to the class attribute</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_addHTML">
<h4>
<a name="method_addHTML">addHTML</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">addHTML</strong>
(
node
,
content
,
where
)
</code>
<div class="description" property="yui:description">
Inserts content in a node at the given location
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">node</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The node to insert into</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">content</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The content to be inserted</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">where</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> Where to insert the content; default is after lastChild</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_byId">
<h4>
<a name="method_byId">byId</a></h4>
<div class="detail" >
<code>
HTMLElement | null
<strong property="yui:name">byId</strong>
(
id
,
doc
)
</code>
<div class="description" property="yui:description">
Returns the HTMLElement with the given ID (Wrapper for document.getElementById).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">id</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> the id attribute</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">doc</span>
<<span property="yui:type">Object</span>>
</code>
<span property="yui:description"> optional The document to search. Defaults to current document</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
HTMLElement | null
</code></dt>
<dd property="yui:returnInfo">The HTMLElement with the id, or null if none found.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_contains">
<h4>
<a name="method_contains">contains</a></h4>
<div class="detail" >
<code>
Boolean
<strong property="yui:name">contains</strong>
(
element
,
needle
)
</code>
<div class="description" property="yui:description">
Determines whether or not one HTMLElement is or contains another HTMLElement.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The containing html element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">needle</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The html element that may be contained.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Boolean
</code></dt>
<dd property="yui:returnInfo">Whether or not the element is or contains the needle.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_create">
<h4>
<a name="method_create">create</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">create</strong>
(
html
,
doc
)
</code>
<div class="description" property="yui:description">
Creates a new dom node using the provided markup string.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">html</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The markup used to create the element</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">doc</span>
<<span property="yui:type">HTMLDocument</span>>
</code>
<span property="yui:description"> An optional document context</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_docHeight">
<h4>
<a name="method_docHeight">docHeight</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">docHeight</strong>
(
)
</code>
<div class="description" property="yui:description">
Document height
</div>
<div class="description">
<dl>
<dt>Returns:
<code property="yui:return">
Number
</code></dt>
<dd property="yui:returnInfo">The current height of the document.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_docScrollX">
<h4>
<a name="method_docScrollX">docScrollX</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">docScrollX</strong>
(
)
</code>
<div class="description" property="yui:description">
Amount page has been scroll horizontally
</div>
<div class="description">
<dl>
<dt>Returns:
<code property="yui:return">
Number
</code></dt>
<dd property="yui:returnInfo">The current amount the screen is scrolled horizontally.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_docScrollY">
<h4>
<a name="method_docScrollY">docScrollY</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">docScrollY</strong>
(
)
</code>
<div class="description" property="yui:description">
Amount page has been scroll vertically
</div>
<div class="description">
<dl>
<dt>Returns:
<code property="yui:return">
Number
</code></dt>
<dd property="yui:returnInfo">The current amount the screen is scrolled vertically.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_docWidth">
<h4>
<a name="method_docWidth">docWidth</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">docWidth</strong>
(
)
</code>
<div class="description" property="yui:description">
Document width
</div>
<div class="description">
<dl>
<dt>Returns:
<code property="yui:return">
Number
</code></dt>
<dd property="yui:returnInfo">The current width of the document.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_elementByAxis">
<h4>
<a name="method_elementByAxis">elementByAxis</a></h4>
<div class="detail" >
<code>
HTMLElement | null
<strong property="yui:name">elementByAxis</strong>
(
element
,
axis
,
fn
,
all
)
</code>
<div class="description" property="yui:description">
Searches the element by the given axis for the first matching element.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The html element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">axis</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The axis to search (parentNode, nextSibling, previousSibling).</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">fn</span>
<<span property="yui:type">Function</span>>
</code>
<span property="yui:description"> optional An optional boolean test to apply.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">all</span>
<<span property="yui:type">Boolean</span>>
</code>
<span property="yui:description"> optional Whether all node types should be returned, or just element nodes.
The optional function is passed the current HTMLElement being tested as its only argument.
If no function is given, the first element is returned.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
HTMLElement | null
</code></dt>
<dd property="yui:returnInfo">The matching element or null if none found.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getAttibute">
<h4>
<a name="method_getAttibute">getAttibute</a></h4>
<div class="detail" >
<code>
String
<strong property="yui:name">getAttibute</strong>
(
el
,
attr
)
</code>
<div class="description" property="yui:description">
Provides a normalized attribute interface.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">el</span>
<<span property="yui:type">String | HTMLElement</span>>
</code>
<span property="yui:description"> The target element for the attribute.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">attr</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The attribute to get.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
String
</code></dt>
<dd property="yui:returnInfo">The current value of the attribute.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getComputedStyle">
<h4>
<a name="method_getComputedStyle">getComputedStyle</a></h4>
<div class="detail" >
<code>
String
<strong property="yui:name">getComputedStyle</strong>
(
An
,
att
)
</code>
<div class="description" property="yui:description">
Returns the computed style for the given node.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">An</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> HTMLElement to get the style from.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">att</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The style property to get.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
String
</code></dt>
<dd property="yui:returnInfo">The computed value of the style property.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getStyle">
<h4>
<a name="method_getStyle">getStyle</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">getStyle</strong>
(
An
,
att
)
</code>
<div class="description" property="yui:description">
Returns the current style value for the given property.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">An</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> HTMLElement to get the style from.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">att</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The style property to get.</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getText">
<h4>
<a name="method_getText">getText</a></h4>
<div class="detail" >
<code>
String
<strong property="yui:name">getText</strong>
(
element
)
</code>
<div class="description" property="yui:description">
Returns the text content of the HTMLElement.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The html element.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
String
</code></dt>
<dd property="yui:returnInfo">The text content of the element (includes text of any descending elements).</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getX">
<h4>
<a name="method_getX">getX</a></h4>
<div class="detail" >
<code>
Int
<strong property="yui:name">getX</strong>
(
element
)
</code>
<div class="description" property="yui:description">
Gets the current X position of an element based on page coordinates.
Element must be part of the DOM tree to have page coordinates
(display:none or elements not appended return false).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> The target element</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Int
</code></dt>
<dd property="yui:returnInfo">The X position of the element</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getXY">
<h4>
<a name="method_getXY">getXY</a></h4>
<div class="detail" >
<code>
Array
<strong property="yui:name">getXY</strong>
(
element
)
</code>
<div class="description" property="yui:description">
Gets the current position of an element based on page coordinates.
Element must be part of the DOM tree to have page coordinates
(display:none or elements not appended return false).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> The target element</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Array
</code></dt>
<dd property="yui:returnInfo">The XY position of the element
TODO: test inDocument/display?</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getY">
<h4>
<a name="method_getY">getY</a></h4>
<div class="detail" >
<code>
Int
<strong property="yui:name">getY</strong>
(
element
)
</code>
<div class="description" property="yui:description">
Gets the current Y position of an element based on page coordinates.
Element must be part of the DOM tree to have page coordinates
(display:none or elements not appended return false).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> The target element</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Int
</code></dt>
<dd property="yui:returnInfo">The Y position of the element</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_hasClass">
<h4>
<a name="method_hasClass">hasClass</a></h4>
<div class="detail" >
<code>
Boolean
<strong property="yui:name">hasClass</strong>
(
element
,
className
)
</code>
<div class="description" property="yui:description">
Determines whether a DOM element has the given className.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The DOM element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">className</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> the class name to search for</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Boolean
</code></dt>
<dd property="yui:returnInfo">Whether or not the element has the given class.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_inDoc">
<h4>
<a name="method_inDoc">inDoc</a></h4>
<div class="detail" >
<code>
Boolean
<strong property="yui:name">inDoc</strong>
(
element
,
doc
)
</code>
<div class="description" property="yui:description">
Determines whether or not the HTMLElement is part of the document.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The containing html element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">doc</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> optional The document to check.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Boolean
</code></dt>
<dd property="yui:returnInfo">Whether or not the element is attached to the document.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_removeClass">
<h4>
<a name="method_removeClass">removeClass</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">removeClass</strong>
(
element
,
className
)
</code>
<div class="description" property="yui:description">
Removes a class name from a given element.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The DOM element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">className</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> the class name to remove from the class attribute</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_replaceClass">
<h4>
<a name="method_replaceClass">replaceClass</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">replaceClass</strong>
(
element
,
oldClassName
,
newClassName
)
</code>
<div class="description" property="yui:description">
Replace a class with another class for a given element.
If no oldClassName is present, the newClassName is simply added.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The DOM element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">oldClassName</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> the class name to be replaced</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">newClassName</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> the class name that will be replacing the old class name</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setAttibute">
<h4>
<a name="method_setAttibute">setAttibute</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setAttibute</strong>
(
el
,
attr
,
val
)
</code>
<div class="description" property="yui:description">
Provides a normalized attribute interface.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">el</span>
<<span property="yui:type">String | HTMLElement</span>>
</code>
<span property="yui:description"> The target element for the attribute.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">attr</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The attribute to set.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">val</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The value of the attribute.</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setStyle">
<h4>
<a name="method_setStyle">setStyle</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setStyle</strong>
(
An
,
att
,
val
)
</code>
<div class="description" property="yui:description">
Sets a style property for a given element.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">An</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> HTMLElement to apply the style to.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">att</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The style property to set.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">val</span>
<<span property="yui:type">String|Number</span>>
</code>
<span property="yui:description"> The value.</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setStyles">
<h4>
<a name="method_setStyles">setStyles</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setStyles</strong>
(
node
,
hash
)
</code>
<div class="description" property="yui:description">
Sets multiple style properties.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">node</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> An HTMLElement to apply the styles to.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">hash</span>
<<span property="yui:type">Object</span>>
</code>
<span property="yui:description"> An object literal of property:value pairs.</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setText">
<h4>
<a name="method_setText">setText</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setText</strong>
(
element
,
content
)
</code>
<div class="description" property="yui:description">
Sets the text content of the HTMLElement.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The html element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">content</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> The content to add.</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setX">
<h4>
<a name="method_setX">setX</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setX</strong>
(
element
,
x
)
</code>
<div class="description" property="yui:description">
Set the X position of an html element in page coordinates, regardless of how the element is positioned.
The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> The target element</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">x</span>
<<span property="yui:type">Int</span>>
</code>
<span property="yui:description"> The X values for new position (coordinates are page-based)</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setXY">
<h4>
<a name="method_setXY">setXY</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setXY</strong>
(
element
,
xy
,
noRetry
)
</code>
<div class="description" property="yui:description">
Set the position of an html element in page coordinates.
The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> The target element</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">xy</span>
<<span property="yui:type">Array</span>>
</code>
<span property="yui:description"> Contains X & Y values for new position (coordinates are page-based)</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">noRetry</span>
<<span property="yui:type">Boolean</span>>
</code>
<span property="yui:description"> By default we try and set the position a second time if the first fails</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_setY">
<h4>
<a name="method_setY">setY</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">setY</strong>
(
element
,
y
)
</code>
<div class="description" property="yui:description">
Set the Y position of an html element in page coordinates, regardless of how the element is positioned.
The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">object</span>>
</code>
<span property="yui:description"> The target element</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">y</span>
<<span property="yui:type">Int</span>>
</code>
<span property="yui:description"> The Y values for new position (coordinates are page-based)</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_toggleClass">
<h4>
<a name="method_toggleClass">toggleClass</a></h4>
<div class="detail" >
<code>
void
<strong property="yui:name">toggleClass</strong>
(
element
,
className
)
</code>
<div class="description" property="yui:description">
If the className exists on the node it is removed, if it doesn't exist it is added.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">element</span>
<<span property="yui:type">HTMLElement</span>>
</code>
<span property="yui:description"> The DOM element.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">className</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> the class name to be toggled</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_winHeight">
<h4>
<a name="method_winHeight">winHeight</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">winHeight</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the inner height of the viewport (exludes scrollbar).
</div>
<div class="description">
<dl>
<dt>Returns:
<code property="yui:return">
Number
</code></dt>
<dd property="yui:returnInfo">The current height of the viewport.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_winWidth">
<h4>
<a name="method_winWidth">winWidth</a></h4>
<div class="detail" >
<code>
Number
<strong property="yui:name">winWidth</strong>
(
)
</code>
<div class="description" property="yui:description">
Returns the inner width of the viewport (exludes scrollbar).
</div>
<div class="description">
<dl>
<dt>Returns:
<code property="yui:return">
Number
</code></dt>
<dd property="yui:returnInfo">The current width of the viewport.</dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
<div rel="yui:events" resource="#events">
</div>
<div rel="yui:attributes" resource="#configattributes">
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div id="moduleList" class="module">
<h4>Modules</h4>
<ul class="content">
<li class=""><a href="module_anim.html" title="anim">anim</a></li>
<li class=""><a href="module_async-queue.html" title="async-queue">async-queue</a></li>
<li class=""><a href="module_attribute.html" title="attribute">attribute</a></li>
<li class=""><a href="module_base.html" title="base">base</a></li>
<li class=""><a href="module_cache.html" title="cache">cache</a></li>
<li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li>
<li class=""><a href="module_collection.html" title="collection">collection</a></li>
<li class=""><a href="module_console.html" title="console">console</a></li>
<li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li>
<li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
<li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li>
<li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
<li class=""><a href="module_datatype.html" title="datatype">datatype</a></li>
<li class=""><a href="module_dd.html" title="dd">dd</a></li>
<li class="selected"><a href="module_dom.html" title="dom">dom</a></li>
<li class=""><a href="module_dump.html" title="dump">dump</a></li>
<li class=""><a href="module_event.html" title="event">event</a></li>
<li class=""><a href="module_event-custom.html" title="event-custom">event-custom</a></li>
<li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
<li class=""><a href="module_history.html" title="history">history</a></li>
<li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
<li class=""><a href="module_io.html" title="io">io</a></li>
<li class=""><a href="module_json.html" title="json">json</a></li>
<li class=""><a href="module_node.html" title="node">node</a></li>
<li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li>
<li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li>
<li class=""><a href="module_oop.html" title="oop">oop</a></li>
<li class=""><a href="module_overlay.html" title="overlay">overlay</a></li>
<li class=""><a href="module_plugin.html" title="plugin">plugin</a></li>
<li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
<li class=""><a href="module_queue-promote.html" title="queue-promote">queue-promote</a></li>
<li class=""><a href="module_slider.html" title="slider">slider</a></li>
<li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
<li class=""><a href="module_substitute.html" title="substitute">substitute</a></li>
<li class=""><a href="module_test.html" title="test">test</a></li>
<li class=""><a href="module_widget.html" title="widget">widget</a></li>
<li class=""><a href="module_widget-position.html" title="widget-position">widget-position</a></li>
<li class=""><a href="module_widget-position-ext.html" title="widget-position-ext">widget-position-ext</a></li>
<li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li>
<li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li>
<li class=""><a href="module_yui.html" title="yui">yui</a></li>
</ul>
</div>
<div id="classList" class="module">
<h4>Classes</h4>
<ul class="content">
<li class="selected"><a href="DOM.html" title="DOM">DOM</a></li>
<li class=""><a href="Selector.html" title="Selector">Selector</a></li>
</ul>
</div>
<div id="fileList" class="module">
<h4>Files</h4>
<ul class="content">
<li class=""><a href="color.js.html" title="color.js">color.js</a></li>
<li class=""><a href="dom-class.js.html" title="dom-class.js">dom-class.js</a></li>
<li class=""><a href="dom-ie-style.js.html" title="dom-ie-style.js">dom-ie-style.js</a></li>
<li class=""><a href="dom-region.js.html" title="dom-region.js">dom-region.js</a></li>
<li class=""><a href="dom-screen.js.html" title="dom-screen.js">dom-screen.js</a></li>
<li class=""><a href="dom-style.js.html" title="dom-style.js">dom-style.js</a></li>
<li class=""><a href="dom.js.html" title="dom.js">dom.js</a></li>
<li class=""><a href="selector-css2.js.html" title="selector-css2.js">selector-css2.js</a></li>
<li class=""><a href="selector-css3.js.html" title="selector-css3.js">selector-css3.js</a></li>
<li class=""><a href="selector-native.js.html" title="selector-native.js">selector-native.js</a></li>
</ul>
</div>
<div id="methodsList" class="module">
<h4>Methods</h4>
<ul class="content">
<li class="private"><a href="#method__bruteContains" title="_bruteContains">_bruteContains</a></li>
<li class="private"><a href="#method__getDoc" title="_getDoc">_getDoc</a></li>
<li class="private"><a href="#method__getRegExp" title="_getRegExp">_getRegExp</a></li>
<li class="private"><a href="#method__getWin" title="_getWin">_getWin</a></li>
<li class=""><a href="#method_addClass" title="addClass">addClass</a></li>
<li class=""><a href="#method_addHTML" title="addHTML">addHTML</a></li>
<li class=""><a href="#method_byId" title="byId">byId</a></li>
<li class=""><a href="#method_contains" title="contains">contains</a></li>
<li class=""><a href="#method_create" title="create">create</a></li>
<li class=""><a href="#method_docHeight" title="docHeight">docHeight</a></li>
<li class=""><a href="#method_docScrollX" title="docScrollX">docScrollX</a></li>
<li class=""><a href="#method_docScrollY" title="docScrollY">docScrollY</a></li>
<li class=""><a href="#method_docWidth" title="docWidth">docWidth</a></li>
<li class=""><a href="#method_elementByAxis" title="elementByAxis">elementByAxis</a></li>
<li class=""><a href="#method_getAttibute" title="getAttibute">getAttibute</a></li>
<li class=""><a href="#method_getComputedStyle" title="getComputedStyle">getComputedStyle</a></li>
<li class=""><a href="#method_getStyle" title="getStyle">getStyle</a></li>
<li class=""><a href="#method_getText" title="getText">getText</a></li>
<li class=""><a href="#method_getX" title="getX">getX</a></li>
<li class=""><a href="#method_getXY" title="getXY">getXY</a></li>
<li class=""><a href="#method_getY" title="getY">getY</a></li>
<li class=""><a href="#method_hasClass" title="hasClass">hasClass</a></li>
<li class=""><a href="#method_inDoc" title="inDoc">inDoc</a></li>
<li class=""><a href="#method_removeClass" title="removeClass">removeClass</a></li>
<li class=""><a href="#method_replaceClass" title="replaceClass">replaceClass</a></li>
<li class=""><a href="#method_setAttibute" title="setAttibute">setAttibute</a></li>
<li class=""><a href="#method_setStyle" title="setStyle">setStyle</a></li>
<li class=""><a href="#method_setStyles" title="setStyles">setStyles</a></li>
<li class=""><a href="#method_setText" title="setText">setText</a></li>
<li class=""><a href="#method_setX" title="setX">setX</a></li>
<li class=""><a href="#method_setXY" title="setXY">setXY</a></li>
<li class=""><a href="#method_setY" title="setY">setY</a></li>
<li class=""><a href="#method_toggleClass" title="toggleClass">toggleClass</a></li>
<li class=""><a href="#method_winHeight" title="winHeight">winHeight</a></li>
<li class=""><a href="#method_winWidth" title="winWidth">winWidth</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright © 2009 Yahoo! Inc. All rights reserved.
</div>
</div>
<script type="text/javascript">
ALL_YUI_PROPS = [{"access": "", "host": "DOM", "name": "addClass", "url": "DOM.html#method_addClass", "type": "method"}, {"access": "", "host": "DOM", "name": "addHTML", "url": "DOM.html#method_addHTML", "type": "method"}, {"access": "private", "host": "DOM", "name": "_bruteContains", "url": "DOM.html#method__bruteContains", "type": "method"}, {"access": "", "host": "DOM", "name": "byId", "url": "DOM.html#method_byId", "type": "method"}, {"access": "", "host": "DOM", "name": "contains", "url": "DOM.html#method_contains", "type": "method"}, {"access": "", "host": "DOM", "name": "create", "url": "DOM.html#method_create", "type": "method"}, {"access": "", "host": "DOM", "name": "docHeight", "url": "DOM.html#method_docHeight", "type": "method"}, {"access": "", "host": "DOM", "name": "docScrollX", "url": "DOM.html#method_docScrollX", "type": "method"}, {"access": "", "host": "DOM", "name": "docScrollY", "url": "DOM.html#method_docScrollY", "type": "method"}, {"access": "", "host": "DOM", "name": "docWidth", "url": "DOM.html#method_docWidth", "type": "method"}, {"access": "", "host": "DOM", "name": "elementByAxis", "url": "DOM.html#method_elementByAxis", "type": "method"}, {"access": "", "host": "DOM", "name": "getAttibute", "url": "DOM.html#method_getAttibute", "type": "method"}, {"access": "", "host": "DOM", "name": "getComputedStyle", "url": "DOM.html#method_getComputedStyle", "type": "method"}, {"access": "private", "host": "DOM", "name": "_getDoc", "url": "DOM.html#method__getDoc", "type": "method"}, {"access": "private", "host": "DOM", "name": "_getRegExp", "url": "DOM.html#method__getRegExp", "type": "method"}, {"access": "", "host": "DOM", "name": "getStyle", "url": "DOM.html#method_getStyle", "type": "method"}, {"access": "", "host": "DOM", "name": "getText", "url": "DOM.html#method_getText", "type": "method"}, {"access": "private", "host": "DOM", "name": "_getWin", "url": "DOM.html#method__getWin", "type": "method"}, {"access": "", "host": "DOM", "name": "getX", "url": "DOM.html#method_getX", "type": "method"}, {"access": "", "host": "DOM", "name": "getXY", "url": "DOM.html#method_getXY", "type": "method"}, {"access": "", "host": "DOM", "name": "getY", "url": "DOM.html#method_getY", "type": "method"}, {"access": "", "host": "DOM", "name": "hasClass", "url": "DOM.html#method_hasClass", "type": "method"}, {"access": "", "host": "DOM", "name": "inDoc", "url": "DOM.html#method_inDoc", "type": "method"}, {"access": "", "host": "Selector", "name": "inRegion", "url": "Selector.html#method_inRegion", "type": "method"}, {"access": "", "host": "Selector", "name": "intersect", "url": "Selector.html#method_intersect", "type": "method"}, {"access": "", "host": "Selector", "name": "inViewportRegion", "url": "Selector.html#method_inViewportRegion", "type": "method"}, {"access": "", "host": "Selector", "name": "operators", "url": "Selector.html#property_operators", "type": "property"}, {"access": "", "host": "Selector", "name": "PARENT_NODE", "url": "Selector.html#property_PARENT_NODE", "type": "property"}, {"access": "", "host": "Selector", "name": "query", "url": "Selector.html#method_query", "type": "method"}, {"access": "", "host": "Selector", "name": "region", "url": "Selector.html#method_region", "type": "method"}, {"access": "", "host": "DOM", "name": "removeClass", "url": "DOM.html#method_removeClass", "type": "method"}, {"access": "", "host": "DOM", "name": "replaceClass", "url": "DOM.html#method_replaceClass", "type": "method"}, {"access": "", "host": "DOM", "name": "setAttibute", "url": "DOM.html#method_setAttibute", "type": "method"}, {"access": "", "host": "DOM", "name": "setStyle", "url": "DOM.html#method_setStyle", "type": "method"}, {"access": "", "host": "DOM", "name": "setStyles", "url": "DOM.html#method_setStyles", "type": "method"}, {"access": "", "host": "DOM", "name": "setText", "url": "DOM.html#method_setText", "type": "method"}, {"access": "", "host": "DOM", "name": "setX", "url": "DOM.html#method_setX", "type": "method"}, {"access": "", "host": "DOM", "name": "setXY", "url": "DOM.html#method_setXY", "type": "method"}, {"access": "", "host": "DOM", "name": "setY", "url": "DOM.html#method_setY", "type": "method"}, {"access": "", "host": "Selector", "name": "shorthand", "url": "Selector.html#property_shorthand", "type": "property"}, {"access": "", "host": "DOM", "name": "toggleClass", "url": "DOM.html#method_toggleClass", "type": "method"}, {"access": "", "host": "Selector", "name": "_tokenize", "url": "Selector.html#method__tokenize", "type": "method"}, {"access": "", "host": "Selector", "name": "viewportRegion", "url": "Selector.html#method_viewportRegion", "type": "method"}, {"access": "", "host": "DOM", "name": "winHeight", "url": "DOM.html#method_winHeight", "type": "method"}, {"access": "", "host": "DOM", "name": "winWidth", "url": "DOM.html#method_winWidth", "type": "method"}];
</script>
</body>
</html>