Hi campers! First of all, thanks.
I´m getting more and more confused with this extremely simple problem. I´m trying to write the less lines as posible, that´s the reason why I´m stucked. I´ve seen that it works with longer code, but the challenge is to reduce it to 2 or 3 lines as much.
I don´t know what I´m doing wrong:
function startcount(){
var seg = 0;
var s = document.getElementById(“counter”);
window.setInterval(function(){
s.innerHTML = seg++;
},1000);
\\this function above creates a counter (in seconds)
}function verDato(){
var freq = 0.13;
var elDato = document.getElementById(“counter”);
dato1.innerHTML = Math.round(elDato*freq)
}
\\this function above tries to multiply the actual value of “counter” by var freq and then replace the value of the id=“dato1” with the result of the multiply
Why returns NaN?? I don´t manage at all Math. and .innerHTML rules so well yet. What I´m doing wrong?
Thanks again!