onChange function is not defined

前端 未结 5 931
醉酒成梦
醉酒成梦 2020-12-20 11:25

This has got to be something simple. I searched the internet and only found syntax errors as the cause of this problem, but I can\'t find a syntax error.

Here\'s the

5条回答
  •  生来不讨喜
    2020-12-20 12:08

    In your code block:

    
    

    hi is not a global function. You can access it only inside the scope of your function(){...}, not from outside.

    Since you are using jQuery, you can change the way you bind your function to the onChange event. Rather than calling it from the html tag, you can write:

    
    

提交回复
热议问题