function stopTimer() {
clearInterval(timer);
var isHovered = $('#theEnd').is(":hover");
if (isHovered == "True") {
return youWon();
}
else {
alert("You lost! try again!")
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Unfortunately, the code always defaults to the else statement even when I'm hovering over the div element with the id="theEnd"