title: Javascript replace - not working with string of html
body: <p>I'm trying to create a sort of 'template' in plain old html, which can then have elements inserted by another javascript function.</p>
  
  <p>So, I've got </p>
  
  <pre><code>var string = "&lt;div id='&lt;@nameInsert&gt;' style='padding: 2px;'&gt;here's some text and stuff&lt;/div&gt;";
  </code></pre>
  
  <p>And in a function I'm trying to replace &lt;@nameInsert> with the name I'm using...</p>
  
  <pre><code>string.replace("/&lt;@nameInsert&gt;", "525");
  </code></pre>
  
  <p>But, it don't work. Some sort of escaping thing, wrong idea this, or what?</p>