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 + "']");
Related Posts:
- How can I get the ID of an element using jQuery?
- How can I get the ID of an element using jQuery?
- jQuery Selector: Id Ends With?
- Set select option ‘selected’, by value
- Wildcards in jQuery selectors
- Set selected option of select box
- jQuery selectors on custom data attributes using HTML5
- Using jquery to get all checked checkboxes with a certain class name
- Toggle Checkboxes on/off
- jQuery: using a variable as a selector [duplicate]
- How can I change CSS display none or block property using jQuery?
- How to set time delay in javascript
- Disable button in jQuery
- Submit a form using jQuery
- Adding placeholder attribute using Jquery
- JavaScript: filter() for Objects
- wait() or sleep() function in jquery?
- Force a default browser on my android phone using a simple html shortcut page
- Ajax Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
- Simple throttle in JavaScript
- Run ScrollTop with offset of element by ID
- Form Submit jQuery does not work
- jQuery multiple events to trigger the same function
- How do I remove a box-shadow effect from an element when another element is hovered?
- jQuery delay not working
- Validate form before submit jquery
- How to save the state of a drag and drop jQuery UI Sortables front end layout editor?
- Display Media Uploader in Own Plugin on WordPress 3.5
- What is the simplest ajax upload plugin or script to be used with wordpress?
- Add tinymce buttons to caption textarea in media uploader
- How to get the path to current theme, but from a JS file?
- How to handle multiple instance of “send_to_editor” js function
- How do I use WP’s jQuery
- Deregister WordPress jquery on specific page
- Add X meta box inputs based on form at top of meta box, how to do it right?
- Stylizing external SVG files with jQuery and CSS
- wp_enqueuescript won’t load in footer even with true value set?
- jQuery Ajax() doesn’t work when the page is accessed as a WordPress template page
- WordPress REST endpoint not able to reach with jQuery
- Execution of JavaScript on save post
- Is placing stuff in page text edit window bad form?
- Add colorpicker to featured image
- Googles jQuery: Are There Avantages to Using It?
- Passing JSON-encoded HTML from WordPress to JavaScript
- Tags in WordPress 3.2
- php ajax problem – weird 301 responses!
- Create URL with parameter for JQuery toggle status
- Stop theme’s jQuery function from running
- Making the wordpress login form a jQuery dropdown
- WordPress Ajax problem with undefined url
- Use Media Uploader on Multiple Images on same page
- Add a class to posts in increments of 2
- Move jQuery to the bottom of the page whilst keeping the WordPress jQuery
- Intergrating agile carousel to wordpress: how to write the ajax_callback function
- How can I fire a jQuery event once getBlocks() actually returns the post’s blocks instead of null?
- WordPress + BlockUI or a splash page [closed]
- WP UI style within shortcode – Any Suggestions?
- Add/remove action on jQuery toggle
- Firebug says jQuery is loaded but $() and jQuery() are not defined
- Why is my WordPress loading old version of JQuery?
- Why load JS through the CMS framework? [duplicate]
- delete post meta by AJAX
- url – ajax loaded but no JS
- jQuery does not work on WordPress editor
- Adding URL of PDF from Thickbox in a Meta Box
- how to json_encode(); the Loop content so that the encoded array is [“0”:content, “1”:content]
- Jquery not loaded by default in wordpress 5.6
- problem with jquery 3.5.1 in footer
- How to call custom jQuery plugins into the customizer controls
- Change zurb foundation top bar style on.scroll in wordpress theme using jquery and css
- click event to unhide something after ajax not firing
- how to use wp_editor() here am getting empty result
- jQuery is not defined, working on local server but not online
- WP_ENQUEUE not working with Foundation 5
- Save jQuery UI Sortable on WordPress
- Why does WordPress load jQuery in my header instead of footer?
- Problem adding MP3 attachments to a jPlayer playlist
- problems with jquery external rss feed integration
- wp_enqueue_script jquery and jquery ui not working
- Axis guidelines over an image
- WordPress forbidden 403 on delete in production vs local environment
- jquery Autocomplete
- Homepage loads many unnecessary jquery-ui files
- Get ajaxForm response value
- Update a parent theme JQuery property in the child theme
- Adding scripts before plugins scripts
- jQuery search function not running in WordPress but running locally (fiddle)
- Refresh widget admin page resetting jQuery hidden class
- Autocomplete for titles via ajax – rework of past post away from like_escape()
- Can’t seem to get JQuery working (wordpress plugin)
- Ajax Request with jQuery not happening
- Bootstrap with Flexslider jQuery Issue
- Console shows ReferenceError: jQuery is not defined, no clue why!
- Sorting UL Listing Within the TinyMCE Visual Editor in WordPress
- My .js file is getting a 404
- Contact Form 7 submission does not complete [closed]
- Combo box populating a DIV using ajax/jquery
- how to display post in jquery slider and carousel
- Carousel Hover Image
- What is calling jquery?