Answers for "url(image loacation) give a class"

0

url(image loacation) give a class

var basePath = 'mysite/images/';
$('a').each(function() {
    var className = $(this).attr('class');
    className = className.replace(/[^f][^0-9]*/, '').replace(' ', '');
    $(this).css('background-image', basePath + className + '.png');
});
Posted by: Guest on August-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language