mirror of
https://github.com/arfct/itty-bitty.git
synced 2026-03-11 08:54:33 +00:00
add el to bitty.js
This commit is contained in:
parent
2dfec6e447
commit
2d411ac5f9
1 changed files with 7 additions and 0 deletions
|
|
@ -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:(?<mediatype>(?<type>[a-z]+)\/(?<subtype>[a-z+]+))?(?<params>(?:;[^;,]+=[^;,]+)*)?(?:;(?<encoding>\w+64))?,(?<data>.*)$/
|
||||
///^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i;
|
||||
|
|
|
|||
Loading…
Reference in a new issue