JavaScript does not replace the last symbol of the string
<p>I have try to replace a symbol in JavaScript, but somehow this is always only replace the 1st symbol of the string instead of replaced all the symbol. </p>

<p><strong>JavaScript</strong>:</p>

<pre><code>var note = "test'test'test'";
note = note .replace("'", "&amp;#39;");
</code></pre>

<p><strong>Output</strong>:</p>

<pre><code>test&amp;#39;test'test'
</code></pre>

<p>Does anyone know how can I can replace all <code>'</code> symbols with <code>&amp;#39;</code> ??</p>
