Documentation

Event.bindOnce

Event.bindOnce(target: Element, event: string, handler: (event: Event) => void, options?: listenerOptions)

The event adds hander for the specified event. This handler will be called only once.

import {Event} from 'main.core';

const button = document.querySelector('.ui-btn');

Event.bindOnce(button, 'click', (event) => {
	// ...
});


© «Bitrix24», 2001-2024
Up