 <p>You can not name functions numbers, try this,</p> <pre><code>&lt;input type="button" value="test" /&gt; $('input[type=button]').click( function() { alert("test"); }); </code></pre> <p>Sometimes jsfiddle can be a pain when doing alert functions. </p> <p>You have to make sure to separate your <code>html</code> <code>css</code> and <code>js</code> as much as you can and leave out <code>script tags</code></p> <p>Here is a working example,</p> <p><a href="http://jsfiddle.net/pUeue/" rel="nofollow">Click Here</a></p>