Hi y’all,
I’m a little rusty with my JS (it’s been about 10 years), but I’ve been following a tutorial to create a animated number counter. https://www.wix.com/corvid/forum/community-discussion/how-to-create-animated-number and stepping through the Corvid Documentation. However, I seem to be running into an issue where I’m getting a valid selector error on the text field. I named the textbox “counter1” and my code is here:
let startNum = 0;
let endNum = 500;
const duration = 1000; // 1000 milliseconds
$w.onReady(function () {
setInterval(()=> {
countUp();
}, duration);
});
function countUp(){
if (startNum <= endNum ){
$w('#counter1').text = startNum.toString();
startNum++;
}
}
I’m wondering if I’m missing something obvious or if I’m missing a crucial step? Any help would be great. Thanks in advance!