jquery submit event is not handled -


i experiencing confusing side effects when trying handle submit event. instead of processing jquery event handler, script xyz.php being called.

<script type = "text/javascript">     $(document).ready(function(){         $("#myform").submit(function() {     alert "it works (or not).";             return false;     });     }); </script>  <div id="contact"> <form action="xyz.php" method="post" id="myform">          <input type="text" class = "webform" size="30" id="nam" name="nam" ></input>           <input class = "webform" type="submit" name="submit" id="send" value="send" ></input>  </form> </div>   

this little bit confusing. dont see doing wrong. has idea ?? apreciated. thank you, much, in advance...

wrap alert message in () this:

alert ("it works (or not)."); 

Comments