Dropdown on-page menu - links to other list details page with current record-id

I’m creating an on-page menu for a client record (that has over 20 blocks of categorized data to display based on the front-end’s user permissions). My on-page menu links to 6 x different client record category pages. I’m wondering how to incorporate the current record id of the list-details page into the on-page menu. Right now I’m using this:

    <div class="dropdown-wrapper">
        <label for="menu"></label>
        <select name="menu" id="menu" onchange="handleSelection(this)">
            <option value="">Navigate</option>
            <option value="https://www.example1.com">Option 1</option>
            <option value="https://www.example2.com">Option 2</option>
            <option value="https://www.example3.com">Option 3</option>
            <option value="https://www.example4.com">Option 4</option>
            <option value="https://www.example5.com">Option 5</option>
        <span class="dropdown-arrow"></span>

        function handleSelection(selectElement) {
            const value = selectElement.value;
            if (value) {
                window.location.href = value;

Any suggestions? Thanks!