First: action is the property of form, html5 has defined it as the required property value, onSubmit is an event, and a function is verified when submitted through <input type=submit />. .
Second: To talk about the order of execution, I personally understand that onSubmit is first, first validation. When verification returns false, the action=url address cannot be reached. If it returns true or no return value is yes, then pass and turn to the url address.
Copy the code