How to trigger sidebar-select from js

hello everyone,
in my custom data type module i would like to insert buttons (generated in javascript) which i would like to connect to the sidebar select event. In PHP i would write it like this:

<a class="nested-data-type_button nested-data-type_add_resource o-icon- fa-link button resource-select" data-sidebar-content-url="<?= $this->url('admin/default', ['controller' => 'nested-data-type', 'action' => 'sidebar-select'], false) ?>" href="#item-resource-select">
    Link Item
</a>

how could i trigger this event from within the o:prepare-value function?