从标题看这个问题够简单,事实也是如此,不过在群里还是看到有初学者来询问这个问题,下面就展示一段代码实例,如果实现多个单选按钮实现其中的一个默认选中效果。
代码实例如下:
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 | <!DOCTYPE html> < html > < head > < meta charset = " utf-8" > < title >蚂蚁部落</ title > </ head > < body > < input type = "radio" name = "antzone" /> < input type = "radio" name = "antzone" /> < input type = "radio" name = "antzone" checked/> < input type = "radio" name = "antzone" /> < input type = "radio" name = "antzone" /> </ body > </ html > |
只要给要默认选中的radio标签上添加checked即可实现。
原文发布时间为:2017-2-20
本文作者:admin
本文来自云栖社区合作伙伴“蚂蚁部落”,了解相关信息可以关注蚂蚁部落