Output form 属性

定义和用法

form 属性返回对包含 <output> 元素 的表单的引用。

此属性在成功时返回表单对象。

注释:该属性是只读的。

另请参阅:

HTML 参考手册:HTML <output> tag form attribute

HTML 参考手册:HTML <output> tag

实例

获取包含 <output> 元素的表单的 id:

var x = document.getElementById("myOutput").form.id;

亲自试一试

gramma

outputObject.form

tarfinan

Return value:

Reference to the <form> element containing the <output> element.

If the <output> element is not in the form, it returns null.

Browser support

The numbers in the table indicate the first browser version to fully support this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
10.0 Not supported 4.0 5.1 11.0