关于input单选框的radio属性
最近在做前端頁面的時(shí)候遇到一個(gè)問題(后端php猴子前端不怎么寫)
我寫了一段代碼:
<form action="">
?? ??? ?<label for=""><input type="radio" ></label><br>
?? ??? ?<label for=""><input type="radio" ></label><br>
?? ??? ?<label for=""><input type="radio" ></label><br>
</form>
但是在選則的時(shí)候明明是單選框卻能選中多個(gè)????最后的解決辦法如此簡單.......原諒我這一生不羈放縱前端渣
<form action="">
?? ??? ?<label for=""><input type="radio" name="aa"></label><br>
?? ??? ?<label for=""><input type="radio" name='aa'></label><br>
?? ??? ?<label for=""><input type="radio" name='aa'></label><br>
</form>
將他們的name屬性設(shè)置成一毛一樣就可以實(shí)現(xiàn)互斥了? 記住了,name屬性值不設(shè)置不行,設(shè)置的不一樣也不行
祝大家周末愉快
?
轉(zhuǎn)載于:https://www.cnblogs.com/wyqn/p/6535789.html
總結(jié)
以上是生活随笔為你收集整理的关于input单选框的radio属性的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 官网3.15课程一起来“打价”,找群内管
- 下一篇: codeforces 15C. Indu