1
I made this script in jQuery to put a different icon depending on the extension that ends the href
, but wanted to know how I can put the icon using CSS instead of tag <img>
, 'Cause it looks like you’re half-witted.
<script src="jquery-3.2.1.min.js"></script>
<script>
$( function(e) {
$("li a[href $= '.zip']").before("<img src='imagens/icon_zip.gif'>");
$("li a[href $= '.pdf']").before("<img src='imagens/icon_pdf.gif'>");
});
</script>