Home >Web Front-end >HTML Tutorial >Regarding the submit response to the carriage return event in the form_html/css_WEB-ITnose

Regarding the submit response to the carriage return event in the form_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:18:191225browse






Click on any text box in this way, and you can respond after pressing Enter

But if you remove the last input, you will not be able to respond to Enter. This What is the reason?


Reply to discussion (solution)

Enter triggers the onsubmit event. If it pops up, it must be written in the onsubmit event.

Enter triggers the onsubmit event. If it pops up, it must be written in the onsubmit event.
I am just curious about the onclick event of the submit component. Pressing Enter may not respond under different circumstances

onsubmit is to submit the form, and onclick is to click the mouse.
They were originally designed for different situations. Why design two for the same situation?

Although I still don’t understand it very clearly, I feel that there is no need to get into trouble

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn