Replace string Jquery
<p>I am doing the following thing to replace some part of the string. I want to replace all three occurence of the string but it is not working.</p>

<pre><code> var  hdnval = document.getElementById("hdnColgval").value = response;
$("#ddcolgs").val($("#ddcolgs").val().replace(/'+hdnval+'/g, response));
</code></pre>
