<body>
<form>
<input type="radio" name="amount" value="10"/> $10 
<input type="radio" name="amount" value="25"/> $25 
<input type="radio" name="amount" value="50"/> $50 
<input type="radio" name="amount" value="100"/> $100 
<input type="radio" name="amount" value="250"/> $250 
<input type="radio" name="amount" value="other"/> Other
</form>
</body>
要使$ 50选项成为默认选择,我将使用哪些HTML代码?
答案 0 :(得分:13)
只需将其设置为已选中:
<body>
<form>
<input type="radio" name="amount" value="10"/> $10 
<input type="radio" name="amount" value="25"/> $25 
<input type="radio" name="amount" value="50" checked="checked" /> $50 
<input type="radio" name="amount" value="100"/> $100 
<input type="radio" name="amount" value="250"/> $250 
<input type="radio" name="amount" value="other"/> Other
</form>
</body>
答案 1 :(得分:5)
只需添加
checked =“已检查”
在Button的声明中你想要默认选中。
答案 2 :(得分:3)
<input type="radio" name="amount" value="50" checked="checked"/>
答案 3 :(得分:0)
无需添加“已选中”:
<input type="radio" name="amount" value="50" checked />