 <p>It might be trying to attach the event before the element is ready. Be sure to attached the handler after the DOM is fully loaded.</p> <pre><code>$(function() { $('#hello-world').submit(function(ev) { ev.preventDefault(); // to stop the form from submitting alert("form submitted"); }); }); </code></pre> <p><a href="http://api.jquery.com/ready/" rel="nofollow">http://api.jquery.com/ready/</a></p>