Replace all strings in dom element
<p>I want to replace all '20' inside the id="olderpost" with '30'</p>

<p>I did the following:</p>

<pre><code>&lt;div id="olderpost"&gt;&lt;a onclick="$.ajax({ dataType: 'script', url: '/actions/olderpost/20'}); return false;" href="/actions/olderpost/20"&gt;View older actions&lt;/a&gt;&lt;/div&gt;

$('#olderpost').html().replace('20', '30');
</code></pre>

<p>but nothing changed.</p>
