You have to inject the value of current into an Attribute Equals selector:
$("ul").find(`[data-slide='${current}']`) For older JavaScript environments (ES5 and earlier):
$("ul").find("[data-slide='" + current + "']"); You have to inject the value of current into an Attribute Equals selector:
$("ul").find(`[data-slide='${current}']`) For older JavaScript environments (ES5 and earlier):
$("ul").find("[data-slide='" + current + "']");