Stay organized with collections
Save and categorize content based on your preferences.
blockly > Field > getTextElement
Field.getTextElement() method
Gets the text element.
Signature:
protected getTextElement(): SVGTextElement;
Returns:
SVGTextElement
The text element.
Exceptions
An error if the text element is not defined.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `getTextElement()` method retrieves the SVG text element associated with the field."],["This method is protected, meaning it's primarily for internal use within Blockly."],["If the text element hasn't been defined, calling this method will result in an error."],["The method returns an SVGTextElement object representing the field's text."]]],["The `getTextElement()` method, part of the `Field` class, retrieves the text element associated with a field. It returns an `SVGTextElement`. The method is protected, meaning it's intended for internal class use or by subclasses. If the text element is not defined, the method will throw an error. The primary function of this method is to provide access to the visual text representation of the field.\n"]]