dist/hawtio-utilities.js
function getOrCreateElements(domElement, arrayOfElementNames) {
        var element = domElement;
        angular.forEach(arrayOfElementNames, function (name) {
            if (element) {
                var children = $(element).children(name);
                if (!children || !children.length) {
                    $("<" + name + "></" + name + ">").appendTo(element);
                    children = $(element).children(name);
                }
                element = children;
            }
        });
        return element;
    }
function getOrCreateElements(domElement, arrayOfElementNames) {
        var element = domElement;
        angular.forEach(arrayOfElementNames, function (name) {
            if (element) {
                var children = $(element).children(name);
                if (!children || !children.length) {
                    $("<" + name + "></" + name + ">").appendTo(element);
                    children = $(element).children(name);
                }
                element = children;
            }
        });
        return element;
    }
function getOrCreateElements ( domElement , arrayOfElementNames ) { var element = domElement ; angular . forEach ( arrayOfElementNames , function ( name ) { if ( element ) { var children = $ ( element ) . children ( name ) ; if ( ! children || ! children . length ) { $ ( "<" + name + "></" + name + ">" ) . appendTo ( element ) ; children = $ ( element ) . children ( name ) ; } element = children ; } } ) ; return element ; }
Look up a list of child element names or lazily create them.

Useful for example to get the <tbody> <tr> element from a <table> lazily creating one
if not present.

Usage: var trElement = getOrCreateElements(tableElement, ["tbody", "tr"])
@method getOrCreateElements
@for Core
@static
@param {Object} domElement
@param {Array} arrayOfElementNames
@return {Object}
Look up a list of child element names or lazily create them .