top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
Hi Helena. It looks like you are trying to access the controls before the page has rendered. Try putting the code inside of the $w.onReady function. Your code should look something like this:
let optionOne = [];
let optionTwo = [];
let optionThree = [];
$w.onReady(function () {
optionOne = $w('#btn1, #img1, #txt1');
optionTwo = $w('#btn2, #img2, #txt2');
optionThree = $w('#btn3, #img3, #txt3');
}
export function btn2_click(event) {
optionOne.hide();
optionThree.hide();
optionTwo.show();
}