Using JQuery - preventing form from submitting

后端 未结 13 2718
灰色年华
灰色年华 2020-11-22 06:51

How do I prevent a form from submitting using jquery?

I tried everything - see 3 different options I tried below, but it all won\'t work:

    $(docu         


        
13条回答
  •  难免孤独
    2020-11-22 07:19

    To prevent default/prevent form submission use

    e.preventDefault();
    

    To stop event bubbling use

    e.stopPropagation();
    

    To prevent form submission 'return false' should work too.

提交回复
热议问题