randomly replace a substring in a block of text in javascript or jquery
<p>how would i randomly replace a string in a text using javascript or jquery?</p>

<p>given: <code>&lt;p&gt;foo bar foo baz foo&lt;/p&gt;</code></p>

<p>I want to just randomly replace 1 occurrence of 'foo' with 'buz', so possible results would be:</p>

<pre><code>&lt;p&gt;buz bar foo baz foo&lt;/p&gt;
&lt;p&gt;foo bar buz baz foo&lt;/p&gt;
&lt;p&gt;foo bar foo baz buz&lt;/p&gt;
</code></pre>
