Although your question looks more like a generic javascript question than WordPress specific and would probably be better suited for another forum like stackoverflow.com, I would say the problem in your code is that you’re using id="countdown" for all the countdown elements. You should use class="countdown" if you want to use the element multiple times on a single page. You can also check that you’re getting all the right elements by doing a console.log(elems); after the document.querySelectorAll.
Related Posts:
- How to call a PHP function from Javascript in WordPress
- WordPress Infinite Scroll without using any plugin
- How to preserve PHP modifications while upgrading WordPress?
- Calling a method from functions.php on a click of a button
- How to use WordPress (PHP) functions in AngularJS partials files?
- Understanding WordPress child theme custom JS loading
- Click loads template via ajax
- javaScript in section of WP API
- How to speed up admin-ajax.php in wordpress
- Adding tawk.to code just before body tag on functions.php file
- How do I fetch all comments per post via WP REST API?
- Slide in Panel WordPress Post
- How do I display a user’s previous orders as a select box option on a product?
- Trigger popup in a php if/else statement
- Use menu link or onClick to set a variable
- Populate dropdown with Child Pages based on Parent Page chosen
- remove wp floating submenu in wp dashboard
- How to complete two other input fields, completed the first
- JS file work only in index page
- dynamic dependent select dropdown
- Ajax load more button for comments wordpress
- Noscript not working as it should in wordpress site
- Tell WP register script to load a script only when the entire page is loaded
- Why i can’t get custom fields value or post ID via Ajax?
- How to reference PHP in Javascript
- Time Delay a URL Redirect for Specific Page
- WordPress User Meta value variable into Google Gauge Chart
- Cannot find the php_ini configuration file to find my error log to see why my code is not working
- Adding HTML Code to Replace Text in PHP
- Gutenberg block don’t save rich text content
- Trying to add some custom text into WordPress Post title via function.php
- Update $wpdb query with AJAX
- Using Javascript On Page – Header and Footer Now Missing
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script
- How do I make comment-reply-button with that takes to comment reply form on click
- How to call a function from functions.php with ajax?
- Custom Post type Ajax search results
- WordPress load javascript file if something… (after the page is loaded)
- Automatically refresh page if widget is added to page?
- wordpress all post filter by year
- Find the method which AJAX GET calls
- Display text of price (minus 20%) on every product page in a sentence.
- Help with my first Metabox helper class
- Trouble figuring out how to get my button to submit comment
- how can I make content from a plugin hidden when user is logged in? [duplicate]
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- hiddenQuestions.find is not a function
- Calling a function via a shortcode in javascript
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- Hide or Show Read More Button by Content Area
- Pass media upload value to input field
- Customize default settings on new sites on multisite
- Remove class that has been added by parent theme
- Setting up the child theme so as to enable right-to-left WordPress?
- Design view breaking on Pages
- Hooking new functions to actions + passing parameters
- Replace comment avatars and links at the same time
- Create Logout Link WordPress Admin Menu
- Calculations in functions.php [closed]
- Ajax – Call to undefined function get_option()
- Integrating PHP into Javascript to display map markers with Google API – problem with wp_localize
- Error in custom php function doesn’t exist
- How to pass Select value from Javascript to PHP to generate select option on change
- PHP echo inside javascript
- Pagination broken on is_front_page()
- Content filter won’t work
- Why does the post_type_link hook everything twice?
- Get related product based on subcategory selected from category id with ID 142
- Fetching Initials of the Commentator in the WordPress Website
- Missing a text-domain esc_attr_e
- Extract and display user infromation on an automatically created page
- Is it legal to redefine wp_password_change_notification in a mu plugin?
- How can I assign separate stylesheets to different pages?
- Some problems in custom widget
- Call a function in functions.php from within tags (JS)
- Execute PHP code only with specific user role
- WP Container Displaying Only on First Page of Archive
- PHP function for horizontal Woocommerce thumbnails and badges
- How to call my PHP function with AJAX ? wp_query
- Creating a Function and Call It
- WooCommerce display price before add to cart [closed]
- Show sidebar only to author of post
- how to add custom select field to wordpress edit page
- how to use 2 index.php file One for mobile and one for desktop
- admin-ajax.php 400 bad request – whats wrong with my code?
- All categories options or All categories not Populating
- Add class for the_post_thumbnail_caption()
- Wrapping shortcode content in a span or link
- Weird Behaviour: Not all WordPress Posts appearing
- Permission functions within wordpress
- Adding ID to a Listing but not inside WP_Query while
- WordPress display name string manipulation
- which table updated after logout?
- Accessing WordPress Functions get_permalink() in Vanilla PHP?
- Saving User Input to PHP Variable
- Require Credits Footer
- Undefined variable notice [closed]
- get second ID from array
- How to access admin menu labels and links on front-end?