Button link for javascript code stopped working

An example of using JS to track a button click, which is the correct way to do it would be something like this example from 9 years ago

In your instance you could add a class to your button module like onclick then your JS could be something like this

jQuery(document).ready(function() {
  jQuery(".onclick a").on("click", function( e ) {
    e.preventDefault();
    //
    // code to be executed here
    //
  });
});