Q:

EventListener for value of number

I have played around with addEventListener() but I can't seem to figure out how it works. I want to try to make it so the event listener recognizes when the total amount of money reaches a certain point, then function mow() is triggered.
window.addEventListener(); //???

function mowEm(){
    var moreMow = setInterval('mow()', 1000);
}

function mow(){
    window.money = document.getElementById('tot');
    money.innerHTML = Number(money.innerHTML) + 2;
}

<div class="tot" id="tot">
        0
</div>
<br><br><br>
<div class="element">
    <input class=button type=button value="Hire employee" onclick='mowEm()'>
    Click to mow someone's lawn.
    <input class=button type=button value="MOW" onclick='mow()'>
</div>

Does anyone have any ideas on how I can make this work?

A:

It sounds like you just need to listen for the money amount to reach a certain point and then do something else. You can do that by checking the value each time it goes up:
function mow() {
  money.innerHTML = Number(money.innerHTML) + 2;

  if (money.innerHTML === '8') {
    alert('Amount of 8 reached, fire some function and do something...');
  }
}

//window.addEventListener(); //???
var money = document.getElementById('tot');

function mowEm() {
  var moreMow = setInterval('mow()', 1000);
}

function mow() {
 money.innerHTML = Number(money.innerHTML) + 2;
  
  if (money.innerHTML === '8') {
    alert('Amount of 8 reached, fire some function and do something...');
  }
}
.hidden {
  display: none;
}
.show {
  display: block;
}
h1 {
  font-size:40px;
  text-align:center;
  color:#032441;
}
.tot {
  font-size:90px;
  text-align:center;
  color:#032441;
}
.element {
  font-size:20px;
  text-align:center;
  color:#032441;
}
.button {
  background-color:;
  color:#032441;
  cursor:pointer;
}
<h1>
  Total money:
</h1>
<div class="tot" id="tot">
  0
</div>
<br><br><br>
<div class="element">
  <input class=button type=button value="Hire employee" onclick='mowEm()'>
  Click to mow someone's lawn.
  <input class=button type=button value="MOW" onclick='mow()'>
</div>

