i need some function that keeps editing my html code. if i do it with a loop and echo or print it just places all the stuff under each other and i want them to overwrite it.
i've tried to to something like this
<script type="text/javascript">
function looptext() {
document.getElementsByTagName('p')[0].innerHTML="
Code: Select all
<?php echo date('s'); ?>t=setTimeout("looptext()",1000);
}
</script>
but that didn't work because it calculated date('s') once and then just looped that second so i need to do something like this totally in php so i will need a way to overwrite text on a specific place like document.getElementsByTagName('p')[0].innerHTML and something like setTimeout.can someone help me with that ?