<分区>
我有一个开始按钮,单击它会运行一个循环函数。我如何获得 stopBTN.onClick 来停止正在运行的循环?
https://jsfiddle.net/vduxbnkj/
startBTN.onClick = function(){ runLoop(); }
function runLoop(){
while(condition true){
getFolderContentsLoop();
}
}
function getFolderContentsLoop(){
//loop through folders & files looking for .txt file and if "finished"
delete files and folders
}