event.preventDefault()
The event.preventDefault()
method in jQuery is used to prevent the default action of the event for example the form's submit action when the submit button is pressed.
event.preventDefault()
property ExampleCancel the default submit action
$("form").submit(function( event ) { event.preventDefault(); $('#log').append('<p>default '+event.type+' prevented</p>'); });