I have here a button to start the function. As usual
<button onclick="start()">START</button>
This is my fuction for my loop.
function start() {
               $.ajax({
                    url: url + value,
                    type: 'GET',
                    async: true,
                    success: function(result) {
                        if (result.match("success")) {
                            removeline();
                            live(result);
                        }else {
                            removeline();
                            dead(result);
                        }
                    }
                });
            }, 2000 * index);
}
Now what function can I use to make the execution of the code stop above to stop. I want something like I can start and stop.
 
     
    