Home  >  Article  >  Web Front-end  >  If the button does not write type=button, it will cause submission when clicked_javascript skills

If the button does not write type=button, it will cause submission when clicked_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:56:46982browse

There is something very strange: I clicked a button in a pop-up window, and unexpectedly the pop-up window disappeared. After debugging by the company's js master, I discovered the secret

Copy Code The code is as follows:



Just add a type ="button":
Copy the code The code is as follows:



Different browsers Different rules are supported
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