public/javascripts/yui/carousel/carousel-debug.js
function createElement(el, attrs) {
        var newEl = document.createElement(el);

        attrs = attrs || {};
        if (attrs.className) {
            Dom.addClass(newEl, attrs.className);
        }

        if (attrs.styles) {
            setStyles(newEl, attrs.styles);
        }

        if (attrs.parent) {
            attrs.parent.appendChild(newEl);
        }

        if (attrs.id) {
            newEl.setAttribute("id", attrs.id);
        }

        if (attrs.content) {
            if (attrs.content.nodeName) {
                newEl.appendChild(attrs.content);
            } else {
                newEl.innerHTML = attrs.content;
            }
        }

        return newEl;
    }
function createElement(el, attrs) {
        var newEl = document.createElement(el);

        attrs = attrs || {};
        if (attrs.className) {
            Dom.addClass(newEl, attrs.className);
        }

        if (attrs.styles) {
            setStyles(newEl, attrs.styles);
        }

        if (attrs.parent) {
            attrs.parent.appendChild(newEl);
        }

        if (attrs.id) {
            newEl.setAttribute("id", attrs.id);
        }

        if (attrs.content) {
            if (attrs.content.nodeName) {
                newEl.appendChild(attrs.content);
            } else {
                newEl.innerHTML = attrs.content;
            }
        }

        return newEl;
    }
function createElement ( el , attrs ) { var newEl = document . createElement ( el ) ; attrs = attrs || { } ; if ( attrs . className ) { Dom . addClass ( newEl , attrs . className ) ; } if ( attrs . styles ) { setStyles ( newEl , attrs . styles ) ; } if ( attrs . parent ) { attrs . parent . appendChild ( newEl ) ; } if ( attrs . id ) { newEl . setAttribute ( "id" , attrs . id ) ; } if ( attrs . content ) { if ( attrs . content . nodeName ) { newEl . appendChild ( attrs . content ) ; } else { newEl . innerHTML = attrs . content ; } } return newEl ; }
Create an element, set its class name and optionally install the element
to its parent.
@method createElement
@param el {String} The element to be created
@param attrs {Object} Configuration of parent, class and id attributes.
If the content is specified, it is inserted after creation of the
element. The content can also be an HTML element in which case it would
be appended as a child node of the created element.
@private
Create an element set its class name and optionally install the element to its parent .