I want to concatenate a string but i am facing problem. Actually i have both (” “) and (‘ ‘) in the string. Here it is
var $a = $ul.find("li a[title='Image 1']").addClass("active");
I want to relace one(Image 1) with a variable
imageIndex = parseInt(imageIdArray[1]) + 1;
var $a = $ul.find("li a[title='Image +imageIndex']").addClass("active"); //Replace 1
How can i concatenate it?
Thanks
Change it to
$ul.find("li a[title='Image " + imageIndex + "']")