demos/Collage/fabric.js
function makeElement(tagName, attributes) {
    var el = fabric.document.createElement(tagName);
    for (var prop in attributes) {
      if (prop === 'class') {
        el.className = attributes[prop];
      }
      else if (prop === 'for') {
        el.htmlFor = attributes[prop];
      }
      else {
        el.setAttribute(prop, attributes[prop]);
      }
    }
    return el;
  }
function makeElement(tagName, attributes) {
    var el = fabric.document.createElement(tagName);
    for (var prop in attributes) {
      if (prop === 'class') {
        el.className = attributes[prop];
      }
      else if (prop === 'for') {
        el.htmlFor = attributes[prop];
      }
      else {
        el.setAttribute(prop, attributes[prop]);
      }
    }
    return el;
  }
function makeElement ( tagName , attributes ) { var el = fabric . document . createElement ( tagName ) ; for ( var prop in attributes ) { if ( prop === 'class' ) { el . className = attributes [ prop ] ; } else if ( prop === 'for' ) { el . htmlFor = attributes [ prop ] ; } else { el . setAttribute ( prop , attributes [ prop ] ) ; } } return el ; }
Creates specified element with specified attributes
@method makeElement
@memberOf fabric.util
@param {String} tagName Type of an element to create
@param {Object} [attributes] Attributes to set on an element
@return {HTMLElement} Newly created element
Creates specified element with specified attributes