Skip to content

setTooltip

Official

Set a tooltip on an element.

Import:

import { setTooltip } from 'obsidian';

Signature:

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

Parameters:

Parameter Type Description
el HTMLElement The element to show the tooltip on.
tooltip string The tooltip text to show.
options? TooltipOptions The options for the tooltip.

Returns: void

Example:

setTooltip(document.body, 'foo');

Links to this page: