Label form 属性
Label 对象
实例代码
返回包含 <label> 元素的表单的 id:
var x = document.getElementById("myLabel").form.id;
x 输出结果为:
myForm
定义和用法
form 属性返回一个包含 label 的表单的引用。
如果成功,该属性返回一个表单对象。
注意:该属性是只读的。
浏览器支持





所有主流浏览器都支持 form 属性。
语法
技术细节
返回值: |
一个包含 label 的表单的引用。如果 label 不在表单内,则返回 null。 |
Label 对象