Jquery replace not working for inner strings
<p>I need to replace <code>|||</code> from all the input fields using jquery. But it is only replacing the first item. I need to use regex but I don't know how to add that to the string.</p>

<pre><code>$(document).ready(function() {
    $("#layerPaper").children("div").each(function() {
        $val = $(this).children('input:text');
        $val.val($val.val().replace('|||', '\"'));
    });
}); 
</code></pre>

<p>Thanks.</p>
