InterestEvent: InterestEvent() constructor
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("Popover API")}}{{SeeCompatTable}}{{non-standard_header}}
The **InterestEvent()** constructor creates a new {{domxref("InterestEvent")}} object.
Syntax
js-nolint
new InterestEvent(type, init)Parameters
type- : A string representing the type of event. For
InterestEvent, this is alwaysinterestorloseinterest. init{{optional_inline}}- : An object containing the following property:
source{{optional_inline}}- : An {{domxref("Element")}} representing the interest invoker element on which interest was shown or lost.
Examples
Normally, you would not use this constructor manually. A new InterestEvent object is constructed when a handler is invoked as a result of a relevant event firing.
See the Using interest invokers guide and the {{domxref("HTMLElement.interest_event", "interest")}} event reference page for examples.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- Popover API
- Using interest invokers