Home >
Web Front-end >
JS Tutorial >
Implement checkbox full selection, inverse selection, and cancellation of JavaScript small script exceptions_javascript skills
Implement checkbox full selection, inverse selection, and cancellation of JavaScript small script exceptions_javascript skills
WBOY
Release: 2016-05-16 16:52:58
Original
984 people have browsed it
Today, when I was implementing a JavaScript script to select all checkboxes, invert selections, and cancel, the page always refreshed instantly after clicking, and all the selected checkboxes were cancelled. After debugging for a long time, I discovered that the
After reading the w3c description, I instantly understood that without writing the type attribute, the browser treated it as a submit by default, and the script for my form to be processed was still empty. So the phenomenon of "refresh" occurred!
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