Where to place code

/ Import statement go at the top of your code, outside of onReady()

import wixWindow from 'wix-window';

// Initialization statements without $w() don't need to be in onReady()

let hideCount = 0;

// Code you want to run when the page loads

$w.onReady(function () {

console.log(`Device viewing site is: ${wixWindow.formFactor}`);

// Initialize an element property

$w("#myTextElement").text = "Hover over to hide";

// Call a function on an element to set its initial state

$w("#buttonReset").disable();

// Dynamic event handler to be bound when the page loads

$w("#myTextElement").onMouseIn( (event) => {

event.target.hide();

console.log(`Hidden ${++hideCount} times`);

$w("#buttonReset").enable();

} );

} );

// Static event handler

export function buttonReset_onClick(event) {

$w("#myTextElement").show();

$w("#buttonReset").disable();

}