STAT.buildtools
Element with Text (no attributes)
stat.build.elementWithText(elementType, displayValue);
Builds a element node with no attributes and some display text.
- @param {String} elementType
- @param {String} displayValue
- @returns {Element}
Example:
stat.build.elementWithText('span', 'foo');
Returns: <span>foo</span>
Element with attributes
stat.build.elementWithAttributes(elementToMake, elementAttributes, displayText);
Generic function that will build an element with optional displayText and add attributes to the element based on the map using the map.key as the attribute name and the map.value as the attributes value
- @param {string} elementToMake
- @param {Object} elementAttributes
- @param {string} displayText
- @returns {Element}
Example:
stat.build.elementWithAttributes('div', {class: "foo", id: "faa"}, 'bar');
Returns: <div class="foo" id="faa">bar</div>
Append Created DOM Element to Container
stat.build.putElement(element, container)
Generic function that will append the element as a child to the specified Selector
- @param {Object} element
- @param {String OR Object} container
Example:
stat.build.putElement('elementOjbect', 'div.foo');