Replacing double quotes while sending parameter to javascript function <p>This is JSFiddle :</p> <p><a href="http://jsfiddle.net/5kdek3vn/" rel="nofollow">http://jsfiddle.net/5kdek3vn/</a> </p> <p>I have button as follows:</p> <pre><code>&lt;button class="buttoncss" title="Modify This Artifact File" onclick="setFileDescriptionForUpdate('!@#$%^&amp;amp;*()_+-=~`{}|[]\:" ;'&amp;lt;&amp;gt;?,.="" ','state.dat','167','1','c:\\pp_artifactsuploadedfiles\evalid_318\state.dat');"&gt;Modify&lt;/button&gt; </code></pre> <p>in this on click i am calling <code>setFileDescriptionForUpdate</code> function whose first parameter is string and is as follows:</p> <pre><code>!@#$%^&amp;*()_+-=~`{}|[]\:";'&lt;&gt;?,./ </code></pre> <p>when " is involved in string it creates problem.</p> <p>What changes i can make to avoid this??</p> <p>Please help me.</p>