Extends the native JS DOM API across all grade-A browsers.
1.0
Flow.js.
http://developer.mozilla.org- /en- /docs- /DOM:document.getElementsByClassName
getByClass
| className | the class to retrieve. |
var foo = document.getElementsByClassName("foo");
var foo = document.getByClass("foo"); // shortcuthttp://developer.mozilla.org- /en- /docs- /DOM:document.getElementsByTagName
getByTag
| tagName | the tag to retrieve. |
var foo = document.getElementsByTagName("li");
var foo = document.getByTag("li"); // shortcuthttp://developer.mozilla.org- /en- /docs- /DOM:document.getElementById
getById
| idName | the id to retrieve. |
var foo = document.getElementById("foo");
var foo = document.getById("foo"); // shortcuthttp://developer.mozilla.org- /en- /docs- /DOM:document.getElementsByName
getByName
| name | the name to retrieve. |
var foo = document.getElementsByName("foo");
var foo = document.getByName("foo"); // shortcuthttp://developer.mozilla.org- /en- /docs- /DOM:element.getAttribute
| attribute | the attribute to retrieve. |
var foo = document.getElementById("foo");
var attr = foo.getAttribute("class");
// returns class (yes, even in IE)http://developer.mozilla.org- /en- /docs- /DOM:element.setAttribute
| attribute | the attribute to set. |
| value | the value to set. |
var foo = document.getElementById("foo");
foo.setAttribute("class", "bar");
// sets class (yes, even in IE)http://developer.mozilla.org- /en- /docs- /DOM:element.hasAttribute
| attribute | the attribute to set. |
| value | the value to set. |
var foo = document.getElementById("foo");
if (foo.hasAttribute("class")) {
foo.removeAttribute("class");
}
// (yes, even in IE)These functions are bound to document.defaultView.
| Properties | |
| getComputedStyle | http://developer.mozilla.org- /en- /docs- /DOM:window.getComputedStyle |
| getPropertyValue | Grabs individual property values from an element’s computed style |
| removeProperty | Removes individual property values from an element’s computed style |
| setProperty | Sets individual property values on an element’s computed style |
http://developer.mozilla.org- /en- /docs- /DOM:window.getComputedStyle
| element | the computed element to retrieve. |
| pseudoElt | (optional) the computed pseudo-element to retrieve. |
var foo = document.getElementById("foo");
var computedStyle = document.defaultView.getComputedStyle(foo, null);