Replace apostrophes in a string
<pre><code>var ScanLastName = "212227_O'Connell".replace(/'/g, '');

function btnScan_onclick(divToRefresh) 
{
    ScanDoc1 = $('input.scandocument').val();
    ScanDoc = ScanDoc1.replace(/\s/g, '');
    ScanDocFileName = ScanDoc+ScanLastName;
}
</code></pre>

<p>I don't see the problem.  I get an error that btnScan_onclick is undefined.</p>

<p>I'm trying to remove spaces and apostrophes.</p>

<p>The code was working until I added the code to remove apostrophes.</p>
