jQuery find parent form

前端 未结 5 1759
名媛妹妹
名媛妹妹 2020-12-07 10:13

i have this html

5条回答
  •  抹茶落季
    2020-12-07 10:39

    see also jquery/js -- How do I select the parent form based on which submit button is clicked?

    $('form#myform1').submit(function(e){
         e.preventDefault(); //Prevent the normal submission action
         var form = this;
         // ... Handle form submission
    });
    

提交回复
热议问题