title: jQuery: Replace multiple regex matches with string?
body: <p>I am trying to use this block of code to replace ALL "123"'s in a long string with a different number.</p>
  
  <pre><code>   var new_id = new Date().getTime();
      $('#food').after(
        "&lt;div id='123' name='123'&gt; etc etc".replace('123', new_id)
      );
  </code></pre>
  
  <p>But it's only replacing the first 123 with the new_id. Is there a way to replace all of them?</p>