I have a loader on my page and its html looks like this:
<div class="pace-progress" data-progress-text="Loading 50/100" data-progress="50" style="transform: translate3d(100%, 0px, 0px);">
I want to write a JS that can change the data-progress-text
when the data-progress is 50
from "Loading 50 / 100"
to "Almost there!"
.
I do not know where to start and any help would be greatly appreciated.
if ( $('.pace-progress').attr('data-progress-text') == '50' ) {
(".pace-progress").attr("data-progress-text") == "Almost there!"}