Stay organized with collections Save and categorize content based on your preferences.

blockly > WorkspaceSvg > highlightBlock

WorkspaceSvg.highlightBlock() method

Highlight or unhighlight a block in the workspace. Block highlighting is often used to visually mark blocks currently being executed.


highlightBlock(id: string | null, opt_state?: boolean): void;


Parameter Type Description
id string | null ID of block to highlight/unhighlight, or null for no block (used to unhighlight all blocks).
opt_state boolean (Optional) If undefined, highlight specified block and automatically unhighlight all others. If true or false, manually highlight/unhighlight the specified block.