Can someone help me with this script;
[code]
<script type=”text/javascript”>
<!–
var myArray = new Array();
myArray[0] = “Football”;
myArray[1] = “Baseball”;
myArray[2] = “Cricket”;
var bb = ‘<script type=”text/javascript”>function changeText2(){var userInput = document.getElementById(“userInput”).value;document.getElementById(“boldStuff2″).innerHTML = userInput;}</script><p>Welcome to the site <b id=”boldStuff2″>dude</b> </p> <input type=”text” id=”userInput” value=”Enter Text Here” /><input type=”button” onclick=”changeText2()” value=”Change Text”/>’
var linebreak = “<br />”;
document.write(“For loop code is beginning”);
document.write(linebreak);
for(i = 0; i < 3; i++){
document.write(myArray[i] + bb);
document.write(linebreak);
}
//–>
</script>
the proroblem is: How can I assign different ID with a for loop cycle?