Plugin for custom action (on database)

I’m trying to develop a plugin that will perform a very simple database action. For now the plugin puts an option on the card sidemenu that, upon selection, tries to show some data thru a javascript popup. (I’m past the problem of trying to use “onclick=” and implemented a listener instead).
But when I click, nothing happens. What I can say is that the function is not being called.

Of course, I must be doing something wrong, but I really need this functionality for my project, so I’ll be very thankful for any help on this.

The code is at:

Your script does nothing but call the controller with the task ID. Why not do it directly from the template?

<li>
    <?= $this->url->icon('info-circle', t('Show Task Details'), 'TaskConnectController', 'show', array('task_id' => $task['id'])) ?>
</li>

In case you still want to use the script, I’d recommend using jQuery.

$(function () {
    $('.task-connect-info').click(function(e){
        e.preventDefault();
        // ...
    })
}