You have to inject the value of current into an Attribute Equals selector:
$("ul").find("[data-slide='" + current +"']"); You have to inject the value of current into an Attribute Equals selector:
$("ul").find("[data-slide='" + current +"']");