# LabelNode
Class Inherits TextNode
## About
`LabelNode` provides rich editable label text and exports an HTML label element. Set its target ID to associate it with a field elsewhere in the document.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| ActionItem | index As Integer | ToolbarItem | Returns the label-properties toolbar item. |
| Constructor | value As String = "Label" | (None) | Creates a new label node. |
| Duplicate | (None) | Node | Returns an indepent copy of this node. |
| FromHTML | element As HTMLSupport.HTMLElement | Boolean | Imports a label element. |
| FromJSON | data As JSONItem | Boolean | Restores state from JSON. |
| HTMLTags | (None) | String | Returns the HTML tag names supported by this node type. |
| InspectorSections | (None) | InspectorSection | Returns the user-editable label properties exposed by the inspector. |
| LastActionIndex | (None) | Integer | Returns the last zero-based action index supplied by this node, or -1 when there are no actions. |
| LocalizeToolbarItem | strings As GraffitiProEditor.Editor | (None) | Sets this node type's toolbar item text from the supplied editor's localization properties. The editor calls it when the type is registered, when the editor opens, and when a locale pack is applied to the editor. A custom node type can override it to localize its own toolbar item. |
| PerformAction | index As Integer <br> selectedItem As DesktopMenuItem | (None) | Handles the label-properties toolbar action. |
| PerformToolbarAction | editor As Editor <br> selectedItem As DesktopMenuItem | (None) | Handles activation of the main-toolbar item. |
| ToHTML | (None) | String | Returns an HTML representation of this content. |
| ToJSON | (None) | JSONItem | Returns the persistent state as JSON. |
| ToMarkdown | (None) | String | Returns the label as raw HTML because Markdown has no native form syntax. |
| TypeName | (None) | String | Returns the display name. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| ForID | String | (None) | Gets or sets the ID of the labeled control; an empty value uses implicit containment. |
## Notes
Label text uses the standard rich-text node representation.
### JSON Format
`forID` is the string ID of the associated form control. The label text and styles use the inherited `TextNode` JSON fields.
`forID` is omitted when empty.
## Examples
Register a label prototype before inserting or importing labels.
### Field Label
```xojo
Var label As New GraffitiProEditor.LabelNode("Email address")
label.ForID = "email"
Editor.AddNode(label)
```