This question is a regular feature in Javascript query interview questions, be ready to tackle it.   There are two ways to stop a form: Return false inside function, which is called on form submit. The sample code:
By using event. preventDefault() to stop the default action on the event. The sample code:
$(function(){
$('.submit').on('submit', function(event){
event.preventDefault();
});
})