well, the console said SelectBeatle is undefined... so your function is probably not visible in the html scope when you click the button.
When you say var
, in js, that var only exists inside the current scope. JSFiddle adds a function wrapper in its javascript, limiting your scope.
Of course the best option is to capture the click event of the button:
var btn = document.getElementById('submit');
btn.addEventListener('click',function(event){
SelectBeatle();
});
Here's a fiddle: http://jsfiddle.net/M9ty7/15/