JSFiddle - React, Tailwind, and code Playground
HTML
<div id="body">
<a href="http://www.xyz.com/text.mp3">MP3 File</a>
<a href="http://www.xyz.com/text.txt">TXT File</a>
<a href="http://www.xyz.com/text.jpg">JPG File</a>
</div>
JavaScript
$('#body').find('a').each(function(){
var src=$(this).attr('href');
var a = src.split('.');
var ext = a[a.length-1];
if (ext=='mp3'){
var html = '<embed type="application/x-shockwave-flash"src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=' + encodeURIComponent(src) + '" width="400" height="27" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" />';
$(html).insertAfter($(this));
$(this).remove();
}
});