DOM
addClass(ele, cls) ⇒ void
Add a classname to the Element's list of classnames.
| Param | Type | Description |
|---|---|---|
| ele | element | The Element to which the new class will be added |
| cls | String | The class to add to the Element |
Example
pendo.dom.addClass(elem, 'foo')
dom(htmlString) ⇒ DomQuery
Creates new DOM elements from HTML text.
Returns: DomQuery - array with the newly created elements
| Param | Type | Description |
|---|---|---|
| htmlString | string | HTML syntax used to produce new DOM elements |
Example
pendo.dom('<div><span>this should create an unattached DOM node</span></div>');
getClass(ele) ⇒ String
Get the classname for the Element.
| Param | Type | Description |
|---|---|---|
| ele | element | The Element referenced for the classname. |
Example
var elemClass = pendo.dom.getClass(elem);
hasClass(ele, cls) ⇒ Boolean
Check if the Element has this classname.
| Param | Type | Description |
|---|---|---|
| ele | element | The Element to test for the classname |
| cls | String | The classname to look for on the element |
Example
var hasFooClass = pendo.dom.hasClass(elem, 'foo');
removeClass(ele, cls) ⇒ void
Remove a classname from an Element's classlist.
| Param | Type | Description |
|---|---|---|
| ele | element | The Element from which the class will be removed |
| cls | String | The class to be removed |
Example
pendo.dom.removeClass(elem, 'foo')
setClass(ele, cls) ⇒ void
Sets the classname for an Element.
| Param | Type | Description |
|---|---|---|
| ele | element | The Element that will get the new classlist. |
| cls | String | The classname that will be set. |
Example
pendo.dom.setClass(elem, 'foo bar baz')