Jump to content

Recommended Posts

Posted

Hi,

does anyone know why this javascript-counter can not add any decimal numbers?

 

 

<body onload="javascript:startCounter();">

<script>

function startCounter() {

document.getElementById('counter').innerHTML = parseInt(document.getElementById('counter').innerHTML) + 1.4;

setTimeout('startCounter()', 200);

}

</script>

<div id="counter">0</div>

 

 

Thanks^^

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...