HTML DOM Label objects
Label objects
Label object represents an HTML <keygen> element.
Label Object Access
You can use getElementById () to access the <label> element:
var
x = document.getElementById("myLabel");
尝试一下
Create Label objects
You can use the document.createElement () method to create a <label> element:
var x = document.createElement("LABEL");
尝试一下
Label object properties
属性 | 描述 |
---|---|
control | 返回标注的控件。 |
form | 返回一个包含 label 的表单的引用。 |
htmlFor | 设置或返回 lable 的 for 属性的值。 |
Standard properties and events
Label objects also supports standard attributes and events .
related articles
HTML Tutorial: HTML Forms
HTML Reference Manual: HTML <label> tag