Syntax for handle keypress event is
.keypress( [ eventData ], handler(eventObject) )
eventDataA map of data that will be passed to the event handler.
handler(eventObject)A function to execute each time the event is triggered.
<script> var xTriggered = 0; $('#target').keypress(function(event) { if (event.which == '13') { event.preventDefault(); } xTriggered++; var msg = 'Handler for .keypress() called ' + xTriggered + ' time(s).'; $.print(msg, 'html'); $.print(event); }); </script>
No comments:
Post a Comment