I have always echoed loop incremented variables by using php. Now I want to use the simpler pure javascript.
instead of this:
<script>
<?php
echo "<script>";
for ($i = 1; $i <= 48; $i++) {
echo 'X'.$i;
echo '}';
echo "</script>";
?>
I just want this:
<script>
for (i = 1; i <= 48; i++) {
document.write (X[i]); //What is the correct syntax for this?
}
</script>