JavaScript to redirect specific page

Hello,

I have a dropdown menu in our database, but unfortunately, when you click on the actual dropdown title, it leads to a blank page. There seems to be no way to edit that page, so I want to redirect it to the first page in the dropdown.

I'm really not good with JavaScript, but this is what I have so far:

 

$(document).on('knack-scene-render.scene_809', function(event, scene) {
if (window.location.hash.indexof("#resume-builder") != -1) {
window.location.replace("https://website.com");
}
else {}
});

 

Any ideas why the above doesn't work? I've tried a bunch of variations, but this seems to be as far as I can get. Thank you in advance!

In case anyone is interested, 380030416312 posted the correct code here:

https://support.knack.com/hc/en-us/community/posts/115000049411-Dropdown-Menu-Link

 

$(document).on('knack-scene-render.scene_284', function(event, scene) { 
window.location.href = "https://......";
});

Replace 'scene_284' with the scene number of your drop-down menu and add your redirect URL.

 

It worked beautifully for me.