Stay organized with collections
Save and categorize content based on your preferences.
blockly > WorkspaceSvg > createDom
WorkspaceSvg.createDom() method
Create the workspace DOM elements.
Signature:
createDom(opt_backgroundClass?: string, injectionDiv?: HTMLElement): Element;
Parameters
Parameter |
Type |
Description |
opt_backgroundClass |
string |
(Optional) Either 'blocklyMainBackground' or 'blocklyMutatorBackground'. |
injectionDiv |
HTMLElement |
(Optional) |
Returns:
Element
The workspace's SVG group.
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 2025-05-16 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 2025-05-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003ecreateDom\u003c/code\u003e method generates the necessary DOM elements for a Blockly workspace within an SVG group.\u003c/p\u003e\n"],["\u003cp\u003eThis method optionally accepts a background class for styling and an injection point element.\u003c/p\u003e\n"],["\u003cp\u003eThe workspace's SVG group element is returned, facilitating further manipulation and integration.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [WorkspaceSvg](./blockly.workspacesvg_class.md) \\\u003e [createDom](./blockly.workspacesvg_class.createdom_1_method.md)\n\nWorkspaceSvg.createDom() method\n-------------------------------\n\nCreate the workspace DOM elements.\n\n**Signature:** \n\n createDom(opt_backgroundClass?: string, injectionDiv?: HTMLElement): Element;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|---------------------|-------------|----------------------------------------------------------------------------|\n| opt_backgroundClass | string | *(Optional)* Either 'blocklyMainBackground' or 'blocklyMutatorBackground'. |\n| injectionDiv | HTMLElement | *(Optional)* |\n\n**Returns:**\n\nElement\n\nThe workspace's SVG group."]]