关于input单选框的radio属性

最近在做前端页面的时候遇到一个问题(后端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>

但是在选则的时候明明是单选框却能选中多个????最后的解决办法如此简单.......原谅我这一生不羁放纵前端渣

<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属性设置成一毛一样就可以实现互斥了  记住了,name属性值不设置不行,设置的不一样也不行

祝大家周末愉快

原文地址:https://www.cnblogs.com/wyqn/p/6535789.html