I'm using this code to start a log file :
function startTail(str) {
if (str== "stop") {
stopTail();
} else {
t= setTimeout("getLog()",1000);
}
}
This is called using :
<button id="start" onclick="getLog('start');">
and stopped using :
<button id="stop" onclick="getLog('stop');">
Is there anyway I can change this to one button that will toggle start / stop ?
Try:
You could try this