What triggers random article button to work after hitting enter at search box instead of the search button function?

What triggers random article button to work after hitting enter at search box instead of the search button function?
0.0 0

#1

There must be a cause somehow, but I just have no clue. Any ideas?


#2

I believe since you are using a form element, the first button encountered is treated as a type=“submit” and by default the Enter buttons apparently triggers that button as if it were clicked. You can prevent that by adding type=“button” to the random article button, so it treats that button as just a plain button.


#3

Right on the spot! Thank you again :smiley: