Hello, anyone have anything to put a divider on a timer? I know how to use setTimeout, I just don't know how to do this with a div. Please let me know, thank you very much!
| SitePoint Sponsor |


Hello, anyone have anything to put a divider on a timer? I know how to use setTimeout, I just don't know how to do this with a div. Please let me know, thank you very much!
What are you trying to do?
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


This is all I have so far, I know its wrong. Just can't find any help on google. I am trying to put the div divider on a timer.
<script type="text/javascript">
changediv(){
document.getElementById("div");
setTimeout('changediv()',1000);}
</script>
<div id="div">
</div>
You're confused. You can't put an element on a timer. However, you can put a function on a timer, which is what you're doing. What do you want the function to do?
Your code is fine, though "div" is not a very good ID for an element.
Use class with semantics in mind
The Meaning of Semantics Take II: Naming Conventions for Class and ID in CSS
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


Really? You can't put a div on a timer? Thought you could. What about a table, can you put that on a timer? If anyone knows otherwise please let me know, thanks.





Exactly what do you wanna do? Your sample code will be wall every second and do... nothing.


Forget about my function, I already said I did it wrong and why I need help. Just trying to put a divider on a timer but Krav says I can't.





Ok, but thats the thing, I don't really get what you want to achieve![]()





Are you wanting to hide/show a timer after a set time?
You really need to make posts informative to allow other people to help. I'm amazed that people have actually taken their time to find out actually what you require.
setTimeout will fire an action after a set amount of time.


What do you mean? I made myself so clear. I said I needed to put a divider on a javascript timer. I even showed an example of what I am trying to do, even if it doesn't work. That is so much more clear than I have seem most other posts be. I don't care what kind of timer, I'll figure that out later, I just need to know if it can be done.





No, apparently you didn't make yourself clear. 4 people still don't get what you want to achieve. Just repeating the same phrase again and again will not make the issue clearer.





You made your self clear that you want to put a divider on a timer. But what we need to know is what do you want to do when that timer expires?
as said you can only give setTimeout an function or action to fire when the given time expires. You can't simply pass it an element and hope.
If you could let us know exactly what you want the divider (div I am guessing) to do when the timer expires, and then we can help you further.
You can't simply go to the doctor and say I feel ill, you have to elabourate (sp) to get a successful diagnosis.
I apologize if I am coming across a bit hasty, it's not intended, we are only trying to get somewhere so we can help you.
Bookmarks