The setInterval method returns an interval ID that you need to pass to clearInterval
in order to clear the interval. You're passing a function, which won't work. Here's an example of a working setInterval/clearInterval
var interval_id = setInterval(myMethod,500);
clearInterval(interval_id);