Files

31 lines
743 B
JavaScript
Raw Permalink Normal View History

2026-02-27 11:39:29 +02:00
((global) => {
function createElement(tagName, attributes, text) {
var element = document.createElement(tagName);
var attrs = attributes || {};
var keys = Object.keys(attrs);
for (var i = 0; i < keys.length; i += 1) {
element.setAttribute(keys[i], attrs[keys[i]]);
}
if (text !== undefined && text !== null) {
element.textContent = text;
}
return element;
}
function appendChildren(parent, children) {
for (var i = 0; i < children.length; i += 1) {
parent.appendChild(children[i]);
}
}
global.Y2KDom = {
createElement: createElement,
appendChildren: appendChildren
};
})(window);