Set a Function as an Event Handler with BX24.bind
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
The method BX24.bind sets the function func as the event handler for the event eventName on the page element element.
void BX24.bind(DOMNode element, String eventName, Function func)
Parameters
Required parameters are marked with *
|
Name |
Description |
|
element* |
The HTML element on the page (DOM element) for which the handler needs to be set |
|
eventName* |
The name of the event. For |
|
func* |
The event handler function |
Code Example
How to Use Examples in Documentation
BX24.init(function () {
const button = document.getElementById('run-action');
BX24.bind(button, 'click', function () {
console.log('Button clicked');
});
});
Handling the Response
The method does not return any data (void).