I want to replace all ’20’ inside the id=”olderpost” with ’30’
I did the following:
<div id="olderpost"><a onclick="$.ajax({ dataType: 'script', url: '/actions/olderpost/20'}); return false;" href="/actions/olderpost/20">View older actions</a></div>
$('#olderpost').html().replace('20', '30');
but nothing changed.
replacedoesn’t mutate the string. Try this: