$(document).ready(function() {
var score = 0;
$("body").mousemove(function() {
score++;
$("#result").val(score);
console.log(score);
});
});
The score will increase every time when I move the mouse, but how should I add a function to decrease the score until 0 when the mouse is not moving?