Generic base class for building and manipulating HTML markup.
Objects, which have visual representation, are most likely subclasses of this generic HTML class. It provides a set of functions to define attributes, inline styles, stylesheet selectors, DOM events and inner HTML content either as static properties or calls to the objectâs methods. Direct or implicit call to âtoStringâ method returns properly formatted HTML markup string, which can be used in document.write() call or assigned to the page innerHTML property.
The two-way linking between original javascript object and itâs DOM counterpart is maintained through the use of unique ID for each object. This allows forwarding DOM events back to the proper javascript master object and, if necessary, updating the correct piece of HTML on the page.
var obj = new Active.System.HTML;
element | Returns a reference to the HTML element. |
getAttribute | Returns HTML attribute. |
getClass | Returns CSS selector. |
getContent | Returns static HTML content. |
getEvent | Returns HTML event handler. |
getId | Returns unique ID for the object. |
getStyle | Returns inline CSS attribute. |
getTag | Returns HTML tag for the object. |
init | Initializes the object. |
refresh | Updates HTML on the page. |
refreshClasses | Updates CSS selectors string for an element. |
setAttribute | Sets HTML attribute. |
setClass | Sets CSS selector. |
setContent | Sets static HTML content. |
setEvent | Sets HTML event handler. |
setId | Sets ID string for an element. |
setStyle | Sets inline CSS attribute. |
setTag | Sets HTML tag for the object. |
toString | Returns HTML markup string for the object. |