Execute javascript on tap_action

Is it possible to execute javascript with a tap_action, e.g. change a variable or change css or press a button in the UI.

I would like to execute a tab action on a mushroom template card to press a button expander.

Co2 is the mushroom template card: