add onclick function to a submit button

前端 未结 6 545
青春惊慌失措
青春惊慌失措 2020-11-27 05:14

I\'m just learning javascript and php. I created a contact form and I\'d like the submit button to accomplish two things when I press it:

  1. submit the data to m
6条回答
  •  孤街浪徒
    2020-11-27 05:21

    if you need to do something before submitting data, you could use form's onsubmit.

提交回复
热议问题