Help needed with code to make Dropdown choice jump to anchor

I am a complete novice - with rudimentary HTMS coding knowledge - trying to figure out javascript coding with Corvid.

I have a dropdown - with its various choices assigned with ‘value’(s) 1, 2, 3, etc.
I want the user to ‘jump to’ particular anchors (on the same page), when they pick an option from the dropdown…

I have used the following code to try and achieve this - but obviously there’s something wrong. Even though the code-panel is NOT putting up any ‘red flags’ for my code, yet NOTHING happens when the dropdown choices are picked.

 export function dropdown1_change(event) {  
 if ($w.dropdown1 === 1) {         
 $w.anchor1.scrollTo(true);     
 } else if ($w.dropdown1 === 2) {         
 $w.anchor2.scrollTo(true);     
 }} 

Any help/ guidance/ tutorial would be much appreciated!

Okay, so I was able to get the job done - thanks to this video tutorial - by Andreas Kviby.
Though the ‘code’ is NOT available ‘below the video’, as promised - still, if you are patient enough, the code can be ‘decoded’ from the video - which is what I did!