Home  >  Article  >  Web Front-end  >  input:checkbox multi-select box achieves the same single selection effect as radio

input:checkbox multi-select box achieves the same single selection effect as radio

高洛峰
高洛峰Original
2018-05-17 17:04:282521browse

I recently encountered a small problem, that is, sometimes when we use single-select radio, we will find that after we select one, we can no longer select none, that is, there is no cancel function after selecting. Then I thought of the powerful checkbox, but it has multiple selections. How can I turn it into a single selection? The effect is the same as radio. I wrote a small program myself. The code is very simple, only four lines.
No more nonsense, direct code:

 
 
 
 
 
无标题文档 
 
 

1 2 3 4 5 6 7

More input: checkbox multi-select box to achieve the same single-select effect as radio. For related articles, please pay attention to the PHP Chinese website!

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