Wrap it inside a function.
<script type="text/javascript">
window.onload = function(){
setInterval(div_show, 10);
}
</script>
Also, if you're sure if you want to execute this function only once
when the body loads, you might as well want to use setTimeout
instead of setInterval
. Like
<script type="text/javascript">
window.onload = function(){
setTimeout(div_show, 10);
}
</script>
If you want 10 it to execute after 10 seconds, you need to set the timer parameter to number of seconds * 1000
In your case, 10*1000
Either
setTimeout(div_show, 10*1000);
or
setTimeout(div_show, 10000);