capture click event of submit button jquery

后端 未结 6 1803

I am trying to get the click event of a submit button on my form...



        
6条回答
  •  一生所求
    2021-02-06 00:54

    You need to run your script when the DOM is ready, as well as providing a callback to the click method:

    $(function() {
        $('#submitDemo').click(function() {
            // do your stuff
        });
    });
    

提交回复
热议问题