DOM Input Hidden对象

本文介绍了HTML中的Hidden对象,它是通过<input type="hidden">标签创建的。文章详细解释了如何通过索引或getElementById()访问该对象,并列举了其主要属性,如defaultValue、form、id、name等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Hidden 对象

The Hidden object represents a hidden field in an HTML form. For each instance of an <input type="hidden"> tag in an HTML form, a Hidden object is created.
当HTML表单中出现<input type="hidden">标签就意味着Hidden对象建立起来了

You can access a Hidden object by indexing the elements array (by number or name) of the corresponding form or by using getElementById().
你可以根据表单使用元素数组索引(数字或是名称)或者使用getElementById()来访问Hidden对象。

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

Hidden 对象属性

Property
属性
Description
描述
IE FNW3C
defaultValueSets or returns the initial value of the hidden field
设置或返回hidden field的初始值
312Yes
formReturns a reference to the hidden field's parent form
返回hidden field父表单的参考
312Yes
idSets or returns the id of the hidden field (In IE 4 this property is read-only)
设置或返回hidden field的id
41 No
nameSets or returns the name of the hidden field
设置或返回hidden field的name
312Yes
typeReturns the type of the form element. For a hidden object it will always be "hidden"
返回表单里的元素类型。hidden对象就显示"hidden"
413Yes
valueSets or returns the value of the value attribute of the hidden field
设置或返回hidden field的value属性值
312Yes
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值