Onclick event not firing on jsfiddle.net [closed]

I'm testing some javascript on jsfiddle and for some reason I can't get a function to fire on a button click. Any advice?

jsfiddle link

Answers:

Answer

In the Frameworks & Extensions panel, set onLoad to No wrap - in <body>.

It took me a while to figure this out.

Answer

You have configured JSFiddle to wrap the code in an onload event handler. Consequently the function you are trying to call onclick is out of scope.

Don't use intrinsic event attributes. Use jQuery's (since you are using jQuery already) event binding instead.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us Javascript

©2020 All rights reserved.