I have a very simple JS setInterval and clearInterval example that doesn\'t work. There has got to be an underlying reason why it does not work and I would like to know why
automessage is declared twice - as a global variable and as a local variable. try:
automessage
function turnON() //executed by onclick event A { automessage = setInterval(function(){ something() }, 2000); }