Dropdown menu isn't redirecting links

I have followed the code from this forum in terms of setting dropdown menu options and to redirect each individual choice to a certain link but nothing is being redirected even if I publish the website and try clicking on the dropdown menu. Not too sure if my coding is right so I’m going to paste it down below. It also does mention that there is an error where the element selector function (usually $w) cannot be used before the page is ready. It’s my first time coding and I am really lost. Any help would be great!

(I’m not allowed to post links so just pretend that the bit where is website link is written has an actual website link!)

import wixLocation from ‘wix-location’ ;

$w( “#categorydropdown” ).options = [
{ “label” : “Photo Day” , “value” : " website link " },
{ “label” : “Sports & Specials” , “value” : " website link " },
];

/**

  • Adds an event handler that runs when an input element’s value
    is changed.
  • @param {$w.Event} event
    */
    export function categorydropdown_change(event) {
    let gotoUrl = $w( “#categorydropdown” ).value;
    $w( “#categorydropdown” ).onChange; {
    if (gotoUrl === “Photo Day” ){
    [wixLocation.to(](wixLocation.to("https://online.fotoworks) ["w](wixLocation.to("https://online.fotoworks) ebsite link " );
    }
    if (gotoUrl === “Sports & Specials” ){
    [wixLocation.to(](wixLocation.to("https://fotoworks.fotomerchant) ["w](wixLocation.to("https://fotoworks.fotomerchant) ebsite link " );
    }}

}