code: function makeElement(tag, children, attribs, styles)
  {
      var ele = document.createElement(tag);
      if (children) {
          if (! (children instanceof Array)) {
              children = [children];
          }
          for (var i = 0; i < children.length; ++i) {
              var c = children[i];
              if (c) {
                  if (typeof c == 'string') {
                      c = document.createTextNode(c);
                  } else if (typeof c == 'number') {
                      c = document.createTextNode('' + c);
                  }
                  ele.appendChild(c);
              }
          }
      }
      
      if (attribs) {
          for (var l in attribs) {
              try {
                  ele[l] = attribs[l];
              } catch (e) {
                  console.log('error setting ' + l);
                  throw(e);
              }
          }
      }
      if (styles) {
          for (var l in styles) {
              ele.style[l] = styles[l];
          }
      }
      return ele;
  }
docs: DOM utilities