Home  >  Article  >  Web Front-end  >  js method to determine whether checkbox is selected_Basic knowledge

js method to determine whether checkbox is selected_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 17:48:231306browse

Core tip: On many occasions, you may encounter the problem of determining whether an element on the page is selected. The following is a method of using js to determine whether a CheckBox is selected.
//No number selected

Copy code The code is as follows:

< input type="checkbox" name="checkbox1" checked>







//No one selected
Copy code The code is as follows:








//No number selected
Copy code The code is as follows:









//No one selected
Copy code The code is as follows:



< input type="checkbox" name="test">




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