I found some new countdown timer code and it’s working and has the data suffix in it but noticed it only worked on the first element and after some Googling I found it only worked on the first span tag with the id called delivery-text and that using class is better so I changed the lines below but it’s not working at all now
From
<span id="delivery-text">Super fast delivery available</span>
To
<div class="delivery-text">Super fast delivery available</div>
the class name doesnt have a . in it. (the . is a CSS selector, but getElementsByClassName already is looking at the class value, so you’d just put "delivery-text" in there.
that said,
should work also, but keep in mind that both getElementsByClassName and querySelectorAll will return an array of results, not a singular result.
okay…you cant take an array and do .textContent on it. An array doesnt have a textContent method. You would need to foreach the array, or else use jquery (cause i can see you’ve got that loaded) instead.
I’d suggest you look up foreaching, the jquery equivalent would be to $(“.delivery-text”).text(yourtext)
I’ll see what I can do as not great at javascript so not 100% sure how it would go, could you provide sample code please or code that could get it working, sorry to ask