title: Javascript Value Replace for Multiple Values
body: <p>I am trying to replace multiple values in a string with JS replace().  The values that I want to replace include line breaks, &amp;, #, etc...  I know how to replace one value:</p>
  
  <pre><code>var string = document.getElementById('string').value.replace(\/n/g, '&lt;br&gt;');
  </code></pre>
  
  <p>However, what is the syntax to include other values.  For example, how can I make the below replace functions one function?</p>
  
  <pre><code>var string = document.getElementById('string').value.replace(\/n/g, '&lt;br&gt;')
  var string = document.getElementById('string').value.replace('&amp;', '%26');
  </code></pre>