To implement carriage return!= Submitted questions, you can generally start with the type of button and the number of input boxes.
By default, a single input box, regardless of the type=submit or type=button of the button, enter will submit.
1. When type=submit, no matter how many type=text input boxes are there, enter indicates submission. (submit)
2. When type=button, and there are multiple input boxes, enter will not submit. (button)
3. Solve the problem of submitting the carriage of a single input box. Refer to the second point: you can add an input=text and hide it; then the type type is button.
In practical applications, there is rarely only one input input box, so just remember the second one to deal with it.
Using JS events to prevent form submission is not within the scope of this article, and of course it can be implemented.