JavaScript function for to create HTML-elements
Some thoughts below:


Consider passing attrs as an object or object literal representing key:value pairs.  This would eliminate need for more fragile string parsing approach you currently have.


You could replace all of this:


  attrs = attrs || '';
  innerHtml = innerHtml || '';

  ret = document.createElement(nodeName);

  attrs = attrs.split(/\s/g);

  if (attrs[0]) {
    attrs.forEach(function(attr) {
      attr = attr.split(/=/);

      if (attr[1]) {
        ret.setAttribute(attr[0], attr[1]);
      }
    });
  }



with this:

  attrs = attrs || {};
  innerHtml = innerHtml || '';

  ret = document.createElement(nodeName);

  for (attr in attrs) {
        ret.setAttribute(attr, attrs[attr]);
  }



Consider different name.  "get", in typical programming thought often refers to retrieval of an existing item. I would think createHtmlElement or similar would be more appropriate.
I would strongly consider adding some additional validation around the input node name, to at a minimum make sure you have a non-zero length string.
After element creation, you could determine whether ret contains HTMLUnknownElement object, which would indicate that the browser did not recognize the node name value.  This could be useful if you wanted to fail out at this point to not allow arbitrary tag creation.  Perhaps whether or not to allow arbitrary (custom) tag creation could even be a flag passed as optional parameter.
Consider throwing known Error object rather than vanilla object literal of your own creation. You get a lot more utility from this Error object than from generic object.  Check out the documentation at link below:


https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error

Example:

throw new Error('error message');