The element selector function (usually $w) cannot be used before the page is ready

If I start at this page, it work normally. Once I go to other pages, and came back to this page they come with error of The element selector function (usually $w) cannot be used before the page is ready. I still learning wix code but my first problem that I am facing currently with this code and with error as per title of my post. The error said at line 16.

I wish for any master can assist me in fixing this error

There is a method that is called whenever the page is loaded, called $w.onReady() , and all the elements have to be called inside this method.

It makes sure you only manipulate elements that are ready to be used.

$w.onReady(() => {

}

Your code does not have this method, that’s why you have this error.

Omg thank you so much Bruno! It work.