定义
创建单选钮控件。
Creates a radio button control.
注释
使用单选钮可以将用户可选择的范围限制到一组值中的一个。要实现这一功能,你必须为同一组的单选钮取相同的 name 值。
当用户提交表单时,只有选中的单选钮才会提交其 name / value 的对值,如果该单选钮有值的话。
要将一组单选钮中的一个设置为默认按钮,请将该单选钮的 checked 属性设置为 true。
只有当单选钮指定了 name 属性时,用户才能够选择该单选钮。要取消对某单选钮的选中,用户必须选择该单选钮组中的另外一个。
此元素在 Internet Explorer 3.0 及以上版本的 HTML 和脚本中可用。
此元素是一个内嵌元素。
此元素不需要关闭标签。
Use a radio button control to limit a user's selection to a single value within a set of values. To do this, you must link together each button in a set of radio buttons by assigning each button the same name.
When a user submits a form, a selected radio button only generates a name/value pair in the form data if the button has a value.
To select a radio button as the default button in a set, set the checked property of the button to true.
A user can select a radio button only if the button has a name. To clear a selected radio button, a user must select another button in the set.
The INPUT type=radio element is available in HTML and script as of Internet Explorer 3.0.
This element is an inline element.
This element does not require a closing tag.
示例代码
<input type="radio" name="fruit" value = "Apple">苹果<br>
<input type="radio" name="fruit" value = "Orange" checked>桔子<br>
<input type="radio" name="fruit" value = "Mango">芒果<br>
HTML元素 - input type=radio
原创文章如转载,请注明:转载自悠悠博客 [ http://www.ajaxstu.com/ ]
相关文章:
- onsubmit="return false;"(2007-10-25 4:0:0)
- 限制TextArea区的文字输入数量(2007-9-26 6:30:36)
- ASP表单与用户输入区域(2007-8-7 1:27:35)
- 可编辑的SELECT(2007-7-5 9:14:19)
- 简单的表单验证(后台验证)(2007-7-3 4:27:19)
- ASP连动下拉列表从数据库读取(2007-6-20 1:45:55)
- HTML元素 - input type=hidden(2007-6-15 1:57:14)
- 使用ASP与JAVASCRIPT配合实现多个复选框数据关联显示(2007-5-12 10:14:57)
- 表单:按钮(2007-5-1 1:30:30)
- 高级表单验证-针对多次提交表单(2007-4-20 1:59:42)
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
