title: Can I add javascript dynamically to an existing script element
body: <p>I want to dynamically add javascript to an existing script element something like:</p>
  
  <pre><code>var se = document.createElement('script');
  se.setAttribute('type', 'text/javascript');
  se.innerHTML = 'alert(1)';
  document.getElementsByTagName('head').item(0).appendChild(se);
  </code></pre>
  
  <p>The interesting part is <code>se.innerHTML = 'alert(1)';</code> and if it is valid? If not how can I do this the right way? </p>