i wrote a simple function like a timer why does this code don't go right is says Uncaught ReferenceError: a is not defined why?
function timeee(sec) {
document.getElementById("main").innerHTML = sec;
--sec;
if (sec == -1) {
clearInterval(cleartext);
}
}
function timer() {
var a = document.getElementById("time").value;
var cl = setInterval("timeee(a)", 1000);
window.cleartext = cl;
}