title: replace a string inside a html5 <script>
body: <p>like it's mentioned in the title i'm willing to replace a string inside a script tag <code>&lt;script&gt;</code>. what i want to replace is the string //WRITE by something else.</p>
  
  <pre><code>&lt;script name="general" id="general" type="text/javascript"&gt;
  some code
  //Write
  &lt;/script&gt;
  </code></pre>
  
  <p>So i automatically tried : </p>
  
  <pre><code>ch="new string";
  document.getElementById("general").replace('// WRITE',ch);
  </code></pre>
  
  <p>But i got the following error : Uncaught TypeError: Object <code>#&lt;HTMLScriptElement&gt;</code> has no method 'replace'.
  So i understand that unlike <code>&lt;div&gt;</code>, <code>&lt;script&gt;</code> doesn't use that method. Is there an equivalent method ? Thanks in advance.</p>