Hey guys I’m trying to add the string ‘url(” “) ‘ around my a href ‘rel’ attribute after calling it through jQuery. I just don’t know the right syntax. Here is what I have. I tried to put the url(“”) inside the rel tag, and that didn’t work.
Any help would be greatly appreciated thanks.
$(function() {
$('#list li a').hover( function(){
$("#meow").css( "background", $(this).attr('rel') );
});
});
If you are saying that for an example anchor element like this:
You want to extract the
relattribute and wrap it in'url("...")'so that you end up with this string:Then you can do that as follows:
(Obvioulsy that assumes that
thisis the anchor element in question.)To put that together with the code from your question: