how to trigger a onclick event for a button on tab click?

I am trying to add the functionality of calling a microflow when the tab is on the button please suggest any relevent idea or answer if u have worked on it before.
1 answers

Trigger a microflow when the tab is on the button? Ok, you’ll have a use case for that, so let’s go:

$(document).ready(function() {             //Wait for all dom-elements to be rendered
  let TriggerHappy=$('.triggerhappybutton')[0];  // find input-element of triggerhappybutton
  TriggerHappy.addEventListener("focus", function(){
    <Call your microflow from javascript>
} catch (error) {}

And then there is the bit how to call a microflow from javascript. Use for that passing along your module.microflow:{
    params: {
        actionname: "MyFirstModule.CalledMicroflowFromJS"
    callback: function(obj) {
        // no MxObject expected
        alert("Just petted the cat a little");
    error: function(error) {

For examples see