0
Why won't this button call my javascript function?
5 Respostas
+ 2
try is not a good name!
Change it, and it works ;-)
+ 2
You can't use names like : try , alert ,function , prompt etc as a function name
+ 1
Yes indeed, try is reserved, in your SoloLearn it highlights purple, choose a correct name and it changes to white
Use this
<button onclick ="trybut()">BUTTON</button>
and don't forget to change the name of your function to trybut() too
+ 1
try has a purpose in JavaScript
https://www.w3schools.com/js/js_errors.asp
+ 1
Thanks guys