Browse Source

adds insertStyle fn

main
Andrey Parfenov 4 months ago
parent
commit
f0cfbb4729
  1. 10
      script.js

10
script.js

@ -3,7 +3,7 @@ function createApp() { @@ -3,7 +3,7 @@ function createApp() {
const div = document.createElement('div');
const text = document.createTextNode('Some text');
div.append(text);
appEl.append(div);
appEl.append(div);
}
function copyStatic() {
@ -16,5 +16,13 @@ function copyStatic() { @@ -16,5 +16,13 @@ function copyStatic() {
console.log('staticCopy', staticCopy);
}
function insertStyle() {
const styleText = 'title: { color: aqua; }';
const styleEl = document.createElement('style');
styleEl.innerHTML = styleText;
const staticEl = document.querySelector('#static');
document.body.insertBefore(styleEl, staticEl);
}
createApp();
copyStatic();
Loading…
Cancel
Save