title: Creating javascript dynamically and use it for input type="text"
body: <p>I've created a web app which can change elements by input type="text".App contains a dynamically created CSS and works fine.But dynamically created Javascript doesn't work.How is possible to enable dynamically created script in input type="text" and run change values while texting ? I want to type document.body.style.color='red'; or alert("Hello"); and see changes same second like with CSS.</p>
  
  <pre><code>var a = document.createElement("style");
  a.type = "text/css";
  document.body.appendChild(a);
  
  var b = document.createElement("script");
  b.type = "text/javascript";
  document.body.appendChild(b);
  
  function changeBackgrounds() {
  
    document.body.style.color = document.querySelector("#r").value;
    document.body.style.fontStyle = document.querySelector("#r").value;
    document.querySelector(".p").innerHTML = document.getElementById("r").value;
    document.body.style.backgroundImage = document.querySelector("#r").value;
    document.querySelector("video.video2").style.transition = document.querySelector("#r").value;
    document.querySelector("video.video3").style.animation = document.querySelector("#r").value;
  
    a.innerHTML = document.querySelector("#r").value;
    b.innerHTML = document.querySelector("#r").value;
  
    document.body.style.overflow = document.querySelector("#r").value;
    document.body.style.textDecoration = document.querySelector("#r").value;
    document.body.style.animation = document.querySelector("#r").value;
  
  }
  </code></pre>