top



I don't know what to call this, but,
Is it possible to replace an text into image.
Example:

Download the .rar file

The ".rar" will become an rar file image.
Is that possible?

Can you help me, can you explain this, sorry get's n*** again >_<.

Okay. I'll explain with an example. Let's say that this is in your HTML.

Code:
<a href="#" class="text">*</a>
Your class would be "text". From here, we will replace the star character with an image tag.

Code:
$('.text').each(function() {
    var txt = $(this).text();
    var img = '<img src="img/star.png" alt="' + txt + '" />'
    var html = txt.replace(/\*/g, img);  // replace every star with an image tag
    $(this).html(html);
});
"var" means variation. It acts as the shortcut in javascript and jQuery. So when you see "txt" in the javascript later on, it'll represent:
Code:
$(this).text();

So, with that jQuery above, every star character will be replaced with the image tag in the "var img". Hence, for your case, all you need to do it give your ".rar" a class, or that whole sentence with a class, then replace the star character with ".rar" (without the inverted commas of course). Also, replace the image tag to your desired image link. That should do it.