I want a code that changes text (of maybe a div) after 10 seconds.
So like i could have some text and a link on my page then after 10 seconds it will change to something else and i can make it change to as many things as i want. Then when it goes threw them all it starts over.
<script type="text/javascript">
var content=["<a href='www.url.com'> link 1 </a>",
"< a href='www.url2.com'> link 2 </a>",
"insert html content"]
function change(){
var new=foo.shift()
document.getElementById('change').innerHTML=new;
foo[foo.size-1]=new
}
setInterval(change, 10000);
</script>
<div id="change"> </change>
Hi,
is it possible to change the background color of a webpage from black to white after 20 seconds or so? Please help. Thanks
Yes, of course it is possible. But this is so simple that you ought to Google for the answer.
And please do not revive some long-finished thread. Prefer to start a new thread of your own.
Here you are:-
Code:
<script type = "text/javascript">
document.bgColor = 'black';
setTimeout(changeBGC, 20000); // 20 seconds
function changeBGC(){
document.bgColor = 'white';
}
</script>
"99.9 percent of lawyers give the rest a bad name." - Unknown
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.