I have created a drop down menu with multiple options to chose from. However what ever option I chose it directs me to the same URL. In this case the last written code. Could someone please tell me what I have missed in the code?
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#dropdown1").onChange((event, $w) => {
console.log(event.target.value); //iPhone X
wixLocation.to("/iphonex");
});
});
$w.onReady(function () {
$w("#dropdown1").onChange((event, $w) => {
console.log(event.target.value); //iPhone XS
wixLocation.to("/iphonexs");
});
});
$w.onReady(function () {
$w("#dropdown1").onChange((event, $w) => {
console.log(event.target.value); //iPhone XS MAX
wixLocation.to("/iphonexsmax");
});
});