DOM Input Radio 对象

Radio 对象

The Radio object represents a radio button in an HTML form. For each instance of an <input type="radio"> tag in an HTML form, a Radio object is created.
Radio对象代表了HTML表单中Radio按钮,每当HTML表单中出现<input type="radio">标签就意味着Radio被建立起来了

You can access a Radio object by indexing the elements array (by number or name) of the corresponding form or by using getElementById().
你可以从表单元数组的数字或是名称来访问Radio对象,或是使用getELmentById()来访问它

IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).

Radio 对象属性

Property
属性
Description
描述
IE FNW3C
acceptSets or returns a list of content types, which the server processing this form will handle correctly
设置或返回内容的类型,让服务器更准确的处理这个表单。
-  Yes
accesskeySets or returns the keyboard key to access the radio button
设置或返回能够访问这radio按钮的键盘按键。
4  Yes
alignSets or returns the alignment of the radio button according to the surrounding text
设置或返回radio按钮相对周围文字的对齐方式
-  Yes
altSets or returns an alternate text to display if the browser does not support radio buttons
设置或返回对于那些无法支持radio按钮浏览器的替换文字。
-  Yes
checkedSets or returns the current state of the radio button (true if selected and false if not selected)
设置或返回radio按钮当前的状态(当被选中则为true,false则没有选中)
312Yes
defaultCheckedSets or returns the default value of the checked attribute (true if checked by default and false if not)
设置或返回被选中属性的默认值(被默认的选中则为真,不然则为假)
312Yes
disabledSets or returns whether or not the radio button should be disabled
设置或返回radio按钮是否应该禁用。
51 Yes
formReturns a reference to the radio button's parent form
返回包含radio按钮表单的参考
312Yes
idSets or returns the id of the radio button (In IE 4 this property is read-only)
设置或返回radio按钮的id(在IE4中这个属性只读)
41 No
nameSets or returns the name of the radio button
设置或返回radio按钮的name
312Yes
sizeSets or returns the size of the radio button
设置或返回radio按钮的大小
3  Yes
tabIndexSets or returns the tab order for the radio button
设置或返回radio按钮由tab顺序所定义的索引
4  Yes
typeThe type of the form element. For a radio object it will always be "radio"
返回表单元素类型,是radio按钮的话就会返回为"radio"
313Yes
valueSets or returns the value of the value attribute of the radio button
设置或返回radio按钮属性的值
312Yes

Radio 对象方法

Method
方法
Description
描述
IEFNW3C
blur()Removes focus from the radio button
取消对radio按钮的聚焦
412Yes
click()Simulates a mouse-click on the radio button
模拟鼠标点击radio按钮
41 Yes
focus()Sets focus on the radio button
radio按钮获得聚焦
312Yes
select()Selects the radio button
选中radio按钮
412No

Radio 对象方法

Syntax: object.event_name="someJavaScriptCode"
语法:对象.事件名称=“一些JS代码”

Event
事件
Description
描述
IEFNW3C
onBlurExecutes some code when the radio button loses focus
当radio按钮失去聚焦的时候执行代码
412 
onClickExecutes some code when the user clicks on the radio button
当用户点击radio按钮的时候执行一些代码
4   
onFocusExecutes some code when the radio button gets focus
当radio按钮得到聚焦的时候执行一些代码
312 
onSelectStartExecutes some code when the radio button is selected
当radio按钮被选中的时候执行一些代码
4   
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值