Jump to content

Counter Quesiton


soma56

Recommended Posts

Again, I appreciate it Bob but it's not what I'm looking for. I'm trying to figure out how to have a counter that is static, doesn't move or is otherwise always in the same place. I understand the concept of adding++ 'while' something is 'not true' however what I don't get is how you can echo a variable to the same spot as a means of letting know in real time.

Link to comment
https://forums.phpfreaks.com/topic/204893-counter-quesiton/#findComment-1072710
Share on other sites

You should go through W3Schools tutorials: http://www.w3schools.com/

 

<body>
<div id='counter'></div>
</body>

<script type="text/javascript">

theArray = new Array( '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' );

for ( counter in theArray )
{
document.getElementById( 'counter' ).innerHTML = theArray[counter];
}

</script>

Link to comment
https://forums.phpfreaks.com/topic/204893-counter-quesiton/#findComment-1072722
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.