nebmucoy674
Coder
Hey all,
First, thank you for the forum; I've asked only one question and got an answer much quicker than asking my local college professors..... So from my previous post it seems I have problems with more than (1) script on one page. Is that why I can't get the first and third JS to run. Any help is always appreciated! As I said, I can get the button to change between images, but the text color change and the array (That is supposed to be a list!) is not. So frustrating understanding one part of JS and not seeing what I'm doing wrong; I have had so obvious syntax errors in the past. Thank you for looking!
First, thank you for the forum; I've asked only one question and got an answer much quicker than asking my local college professors..... So from my previous post it seems I have problems with more than (1) script on one page. Is that why I can't get the first and third JS to run. Any help is always appreciated! As I said, I can get the button to change between images, but the text color change and the array (That is supposed to be a list!) is not. So frustrating understanding one part of JS and not seeing what I'm doing wrong; I have had so obvious syntax errors in the past. Thank you for looking!
JavaScript:
<body>
<button id="Text_Output">Change Color</button>
<div>
<p id="Text_Output">Change Color</p>
</div>
<script>
document.getElementById("toWhite").onclick = function () {
document.getElementById("Text_Output").style.color = 'white';
}
</script>
<br>
<script>
function pictureChange()
{
document.getElementById("flower").src="flower.jpeg";
}
</script>
<img id="flower" src="flowerbud.jpg">
<p><input type="button" id="becomeflower" value="Become Flower, Bloom there it is!" onclick="pictureChange()"></p>
<br>
<h3> The Things I Associate With Spring </h3>
<br>
<p id="Spring_Things"></p>
<script>
const Spring_Things = ["Easter", "Flowers", "Smell of Freshly Cut Grass", "Birds", "Sunshine", "Camping"]
let fLen = Spring_Things.length;
let text = "<ul>";
for (let i = 0; i < fLen; i++) {
text += "<li>" + Spring_Things[i} + "</li>";
}
text += "</ul>";
document.getElementById("Spring_Things").innerHTML = text;
</script>
<br>
</body>