当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > DOM Input Reset 对象
The Reset object represents a reset button in an HTML form. For each instance of an <input type="reset"> tag in an HTML form, a Reset object is created.
Reset对象代表了HTML表单中Reset按钮,每当HTML表单中出现<input type="reset"> 标签就意味着Reset被建立起来了
You can access a Reset object by indexing the elements array (by number or name) of the corresponding form or by using getElementById().
你可以从表单元数组的数字或是名称来访问Reset 对象,或是使用getELmentById()来访问它
IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).
Property 属性 | Description 描述 | IE | F | N | W3C |
---|---|---|---|---|---|
accept | Sets or returns a list of content types, which the server processing this form will handle correctly 设置或返回内容的类型,让服务器更准确的处理这个表单 | - | Yes | ||
accesskey | Sets or returns the keyboard key to access the reset button 设置或返回能够访问这Reset按钮的键盘按键。 | 4 | Yes | ||
align | Sets or returns the alignment of the reset button according to the surrounding text 设置或返回Reset按钮相对周围文字的对齐方式 | - | Yes | ||
alt | Sets or returns an alternate text to display if the browser does not support reset buttons 设置或返回对于那些无法支持Reset按钮浏览器的替换文字。 | - | Yes | ||
defaultValue | Sets or returns the default value of the reset button 设置或返回Reset按钮的默认值 | 3 | Yes | ||
disabled | Sets or returns whether or not the reset button should be disabled 设置或返回Reset按钮是否应该禁用。 | 5 | 1 | Yes | |
form | Returns a reference to the reset button's parent form 返回包含Reset按钮表单的参考 | 3 | 1 | 2 | Yes |
id | Sets or returns the id of the reset button (In IE 4 this property is read-only) 设置或返回Reset按钮的id(在IE4中这个属性只读) | 4 | 1 | No | |
name | Sets or returns the name of the reset button 设置或返回Reset按钮的name | 3 | 1 | 2 | Yes |
size | Sets or returns the size of the reset button | 3 | Yes | ||
tabIndex | Sets or returns the tab order for the reset button 设置或返回Reset按钮由tab顺序所定义的索引 | 4 | Yes | ||
type | Returns the type of the form element. For a reset object it will always be "reset" 返回表单元素类型,是Reset按钮的话就会返回为"reset" | 3 | 1 | 3 | Yes |
value | Sets or returns the value of the value attribute of the reset button 设置或返回Reset按钮value属性的值 | 3 | 1 | 2 | Yes |
Method 方法 | Description 描述 | IE | F | N | W3C |
---|---|---|---|---|---|
blur() | Removes focus from the reset button | 4 | 1 | 2 | Yes |
click() | Simulates a mouse-click on the reset button | 4 | 1 | Yes | |
focus() | Sets focus on the reset button | 3 | 1 | 2 | Yes |
select() | Selects the reset button | 4 | 1 | 2 | No |
Syntax: object.event_name="someJavaScriptCode"
语法:对象.事件名称="一些JS代码"
Event 事件 | Description 描述 | IE | F | N | W3C |
---|---|---|---|---|---|
onBlur | Executes some code when the reset button loses focus 当Reset按钮失去聚焦的时候执行一些代码 | 4 | 1 | 2 | |
onClick | Executes some code when the user clicks on the reset button 当Reset按钮被点击的时候执行一些代码 | 4 | |||
onFocus | Executes some code when the reset button gets focus 当Reset按钮得到聚焦的时候执行一些代码 | 3 | 1 | 2 | |
onSelectStart | Executes some code when the reset button is selected 当Reset按钮被选中的时候执行一些代码 | 4 |