1

I have a dropdown on my html page, when it is first loaded, it is set to a default value. But when a user changes the value, I'm checking the selected value against another text field. If the condition does not satisfy, I want to show an alert to the user and reset the dropdown.

I'm able to show the alert with my condition, but how do I reset the dropdown after showing an alert to the user.

user2628187
  • 313
  • 6
  • 18

1 Answers1

2

You can try

document.getElementById("#dropdownId").selectedIndex = 0
mylee
  • 1,293
  • 1
  • 9
  • 14