html单选颜妞,HTML:单选怎么才能只选一个

下面的代码,看起来比较长,其实只要看其中的(input type = "radio")部分就可以了,贴出全部,以便调试

<html>

<head>

<link rel = "stylesheet" type = "text/css" href = "form.css" />

</head>

<body>

<h1>Include a Note Card </h1>

<form method = "post" action = "test.php">

<p>

<input type = "checkbox" id = "gift" />

<label for = "gift">Check this box if your order is a gift</label>

</p>

<label for = "Name" >Sender's Name :</label>

<input type = "text" id = "Name" value = "Your name" />

<fieldset>

<legend>Color of Paper :</legend>

<label><input type = "radio" value = "blue" name = "blue">Blue</label>

<label><input type = "radio" value = "Pink" name = "Pink">Pink</label>

<label><input type = "radio" value = "White" name = "White" checked = "checked">White</label>

</fieldset>

<label for = "InkColor">Ink Color :</label>

<select id = "InkColor ">

<option selected value = "black">Black</option>

<option selected value = "navy">Navy Blue</option>

<option selected value = "maroon">Maroon</option>

<option selected value = "green">Green</option>

<option selected value = "gray">Gray</option>

<option selected value = "red">Red</option>

</select>

<br />

<label for = "CardMessage">Card Message :</label>

<textarea id = "CardMessage" rows= "4" cols = "40">Type Your Message Here</textarea>

<br />

<label for = "ChooseAFont">Choose a Font :</label>

<select id = "ChooseAFont" size = "4">

<option selected value = "Times">Times New Roman</option>

<option value = "Optima">Optima</option>

<option value = "Verdana">Verdana</option>

<option value = "Papyrus">Papyrus</option>

<option value = "MarkerFelt">Marker Felt</option>

<option value = "Arial">Arial</option>

<option value = "CourierNew">Courier New</option>

</select>

<br /> <button type = "button" value = "back">Go Back</button>

<button type = "submit" value = "submit">Submit</button>

<button type = "reset" value = "reset">Reset</button>

</form>

</body>

</html>

运行了一下,发现其中的单选(input type = "radio")能选好几个,非常纳闷,怎么才能做到只选一个?谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值