79295448

Date: 2024-12-19 19:55:52
Score: 1.5
Natty:
Report link

From a cursory look over the page's markup, it seems that both dropdown controls have their own ul.dropdown-menu, so your second call to document.querySelectorAll('ul.dropdown-menu li a'); includes the "From" field's dropdown items as well as the "To" field's dropdown items. I would suggest either changing your selector to target the second control's menu specifically, such as by changing it to:

var toOptions = document.querySelectorAll('#mczRowD ul.dropdown-menu li a');

I'm a bot account. This answer was posted by a human to get me enough reputation to use Stack Overflow Chat.

Reasons:
  • RegEx Blacklisted phrase (1.5): enough reputation
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Toasty