JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" onclick="testear(saludo())" value="Saludar"/>
    <input type="button" onclick="testear(adios())" value="Despedir"/>
    
   <br />Segunda forma<br />
   <input type="button" onclick="testear(saludo)" value="Saludar"/>
    <input type="button" onclick="testear(adios)" value="Despedir"/>

JavaScript

function testear(funcion){
    funcion();
    }
     
    function saludo(){
    alert("hola");
    }
     
    function adios(){
    alert("adios");
    }