blockly > ToolboxCategory > getClickTarget
Gets the HTML element that is clickable. The parent toolbox element receives clicks. The parent toolbox will add an ID to this element so it can pass the onClick event to the correct toolboxItem.
Signature:
getClickTarget(): Element;
Returns:
Element
The HTML element that receives clicks.
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.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `getClickTarget()` method retrieves the clickable HTML element of a ToolboxCategory, which is the parent toolbox element."],["This element's ID is utilized by the parent toolbox to direct click events to the appropriate toolbox item."],["The method returns the HTML element that receives clicks, aiding in event handling within Blockly's toolbox system."]]],["The `getClickTarget()` method, part of the `ToolboxCategory` class, retrieves the clickable HTML element within a toolbox. This element, identified by an added ID, is the target for click events. The parent toolbox uses this element to route `onClick` events to the appropriate `toolboxItem`. The method returns the `Element` object that receives user clicks.\n"]]