JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" id="inicializar" value="inicializar"/>
<input type="button" id="mover" value="mover"/>

JavaScript

var prueba;

function inicializarEventos(){
    prueba=44444;
    return prueba;
}

function moverMouse(event){
    prueba=777;
    return prueba;
}

window.onload = function(){
    document.getElementById('inicializar').onclick = function(){
        alert(inicializarEventos()); //44444
    };
    document.getElementById('mover').onclick = function(){
        alert(moverMouse());         //777
    };
}