I added an input box and submit button separately onto the page.
What do I want to happen?
When the user types ‘krh’ into the input box and clicks on enter, they are supposed to go to the ‘krh’ page.
import wixLocation from 'wix-location';
$w.onReady(function () {
// Write your JavaScript here
const inputBox = $w('#input2');
const pin = $w('#input2').value;
inputBox.onKeyPress((event)=>{
if(event.key === 'Enter'){
if(pin === 'krh'){wixLocation.to('/krh');}
}
}
)
}
);