mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-28 00:43:08 +00:00
vitreum headtags (temporary change)
This commit is contained in:
8
vitreum/injectTag.js
Normal file
8
vitreum/injectTag.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const injectTag = (tag, props, children) => {
|
||||
const injectNode = document.createElement(tag);
|
||||
Object.entries(props).forEach(([key, val]) => injectNode[key] = val);
|
||||
if (children) injectNode.appendChild(document.createTextNode(children));
|
||||
document.getElementsByTagName('head')[0].appendChild(injectNode);
|
||||
};
|
||||
|
||||
export default injectTag;
|
||||
Reference in New Issue
Block a user