Replace text by an image with jQuery

Since tweets are backed up automatically in this blog and prefixed with ‘Tweet:’, I thought it would be better to replace the prefix by a Twitter icon.

jQuery can do that nicely:

[code]

jQuery(‘h2 a’).html(function(i,html) {
return html.replace(/Tweet\:/g, ‘' + html + '‘);
});

[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: