const React = {
createElement: function (tag, attrs, children) {
var e = document.createElement(tag);
// Add attributes
for (var name in attrs) {
if (name && attrs.hasOwnProperty(name)) {
var v = attrs[name];
if (v === true) e.setAttribute(name, name);
else if (v !== false && v !== null) e.setAttribute(name, v.toString());
}
}
// Append children
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
e.appendChild(child.nodeType ? child : document.createTextNode(child.toString()));
}
return e;
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.