Skip to content

setTooltip

Official

Set a tooltip on an element.

Import:

import { setTooltip } from 'obsidian';

Example:

setTooltip(document.body, 'foo');

Signature:

function setTooltip(el: HTMLElement, tooltip: string, options: TooltipOptions | undefined): void

Parameters:

ParameterTypeDescription
elHTMLElementThe element to show the tooltip on.
tooltipstringThe tooltip text to show.
optionsTooltipOptions | undefinedThe options for the tooltip.

Returns: void

Example:

setTooltip(document.body, 'foo');

Links to this page: