HTMLLabelElement:control 属性

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

HTMLLabelElement.control 只读属性返回与 <label> 元素相关联的控件(以 HTMLElement 类型或其派生类的对象的形式)的引用,如果标签未与控件关联,则为 null

HTMLElement 派生对象,表示与 <label> 关联的控件,如果标签是单独的,则为 null

备注: 如果这个属性有值且 HTMLLabelElement.htmlFor 有值,HTMLLabelElement.htmlFor 属性必须引用相同的控件。

规范

Specification
HTML
# dom-label-control-dev

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
control

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

参见