Close modal form from JavaScript

Hi everyone. I am using the following code to build a modal form.

echo elgg_view('output/url', [

'text' => elgg_echo('add'),

'href' => 'ajax/view/forms/pessek_profile/'.$section.'?guidp='.$user_guid,

'class' => 'elgg-button elgg-button-action man pvn float-alt elgg-lightbox', //'class' => 'elgg-button elgg-button-action man pvn float-alt elgg-lightbox',

//'rel' => 'popup',

]);
 
How can I close the modal form from JavaScript based on click event ??
Best regard.
Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking