Home › Forums › JavaScript › Annoying jQuery Issue › Re: Annoying jQuery Issue
June 9, 2012 at 9:24 am
#104137
Mottie
Member
It is just a typo, or is that really missing a “$”?
$("#p" + currentSlide).attr("src", "img/dot-empty.png");
If that was just a typo, then add a check to make sure the element exists, like this:
var p = $("#p" + currentSlide);
if (p.length){
p.attr("src", "img/dot-empty.png");
}