When you access $(".wanted"+id)
, you are actually trying to access an element with the class name = wanted+id. This is because of the '.' before 'wanted'. Also, you seem to be accessing the tag directly and setting it's
src
attribute. You need to access the tag.
What you could try is this:
var x=document.getElementById(id);
$(x).find("img")[0].setAttribute("src","/images/wanted_.png");