HTMLButtonElement: interestForElement property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

The interestForElement property of the HTMLButtonElement interface gets or sets the target element of an interest invoker, in cases where the associated <button> element is specified as an interest invoker.

See Creating an interest invoker for more details.

Value

An Element object instance, or null if the associated <button> element does not have a target element set.

Examples

Basic interestForElement usage

In this example, we use a <button> element's interestForElement property to set its target element and then retrieve the target element's tagName. The tagName is then printed in the <button> element's text content.

HTML

We include a <button> element and a <div> element. We turn the <div> element into a popover by setting a popover attribute on it.

html
<button href="#">a button</button>
<div id="mypopover" popover>I am a <code>&lt;div&gt;</code> element.</div>

JavaScript

We get references to the <button> and <div> elements in script, then declare an interest invoker-target relationship between the <button> and the <div> by setting the <button> element's interestForElement property equal to a reference to the <div>. We then set the button's text content equal to a string containing the target element's tagName, retrieved via invoker.interestForElement.tagName.

js
const invoker = document.querySelector("button");
const popover = document.querySelector("div");

invoker.interestForElement = popover;

invoker.textContent = `My target is a ${invoker.interestForElement.tagName} element`;

Result

The example renders like this:

Try showing interest in the button (for example, by hovering or focusing it) to make the <div> appear.

Specifications

This feature does not appear to be defined in any specification.

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
interestForElement
Experimental Non-standard
Chrome – Full support
Chrome 142 (Release date: 2025-10-28)
footnote Full support
Edge – Full support
Edge 142 (Release date: 2025-10-31)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 126 (Release date: 2026-01-08)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 142 (Release date: 2025-10-28)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 93 (Release date: 2025-11-25)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – Full support
WebView Android 142 (Release date: 2025-10-28)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
Non-standard. Check cross-browser support before using.

See also