Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.