On the website you're using (JSFiddle), there's 2 dropdown boxes on the left side that allow you to choose additional options. There's a top and and a bottom one. Leave the top one alone - the 2nd one defaults to the option "onLoad" (which does just that - defines and calls your JavaScript function(s) in the onLoad event); change it to the option "No wrap - in <head>" and then click "Update" on the top toolbar. Voila - your button should work now.