        document.addEventListener('keydown', function(event) {

          if (event.key === 'ArrowUp') {

            event.preventDefault(); // Prevent default scrolling behavior

            focusPreviousInput();

          } else if (event.key === 'ArrowDown') {

            event.preventDefault(); // Prevent default scrolling behavior

            focusNextInput();

          }

        });



        function focusPreviousInput() {

          var inputs = document.querySelectorAll('input');

          var focusedIndex = Array.from(inputs).findIndex(input => input === document.activeElement);

          var previousIndex = (focusedIndex === 0) ? inputs.length - 1 : focusedIndex - 1;

          inputs[previousIndex].focus();

        }



        function focusNextInput() {

          var inputs = document.querySelectorAll('input');

          var focusedIndex = Array.from(inputs).findIndex(input => input === document.activeElement);

          var nextIndex = (focusedIndex === inputs.length - 1) ? 0 : focusedIndex + 1;

          inputs[nextIndex].focus();

        }