Skip to main content

Home > 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.

Signature:

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

Parameters

ParameterTypeDescription
idstring | nullID of block to highlight/unhighlight, or null for no block (used to unhighlight all blocks).
opt_stateboolean(Optional) If undefined, highlight specified block and automatically unhighlight all others. If true or false, manually highlight/unhighlight the specified block.

Returns:

void