Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如果没有选中单选按钮_Html - Fatal编程技术网

Html 如果没有选中单选按钮

Html 如果没有选中单选按钮,html,Html,我有以下单选按钮: 我希望我的建筑由以下材料构成: 砖 木材 石 提交 函数验证(){ if(document.querySelectorAll('input[type=“radio”]:checked')。长度

我有以下单选按钮:


我希望我的建筑由以下材料构成:
  • 木材
提交
函数验证(){
if(document.querySelectorAll('input[type=“radio”]:checked')。长度<1){
警报('请至少选择一个');
返回false;
}
警惕(“成功”);
//文件。表格['myform']。提交;
}

我希望我的建筑由以下材料构成:
  • 木材

没有默认选项吗?在纯HTML中无法执行此操作(默认情况下不选中)。您将需要使用javascript。在
changeChanceofive()
方法中添加一个复选框。不推荐使用align=center,请使用style=“text align:center”