I want my code to run when I type a number into my input, but every time I reload the page the code automatically fires.
const dinero = document.getElementById('ValorGanancia');
dinero.addEventListener('keypress', alert('hola mundo'));
<div class="CalculoCalculadora-IngresoTotal">
<p>Bill </p>
<input type="number" name="ValorGanancia" id="ValorGanancia" placeholder="0" value="">
<span class="Logopesos"> <img class="imgPesos" src="./images/icons8-dólar-estadounidense-24.png" alt="" srcset=""></span>
</div>