diff --git a/docs/bitty.js b/docs/bitty.js index b4e8a3c..b3d29fc 100644 --- a/docs/bitty.js +++ b/docs/bitty.js @@ -1,3 +1,10 @@ +window.el = function (tagName, attrs, ...children) { + let l = document.createElement(tagName); + Object.entries(attrs).forEach(([k,v]) => l[k] = v); + children.forEach((c) => l.appendChild(typeof c == "string" ? document.createTextNode(c) : c)); + return l; +} + const dataUrlRE = /^data:(?(?[a-z]+)\/(?[a-z+]+))?(?(?:;[^;,]+=[^;,]+)*)?(?:;(?\w+64))?,(?.*)$/ ///^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i;