I can write code, I like to write code, depending on who you ask I can very good at it at the same time I think I suck, and so would the world and it's okay.
What I want it to do is to make the image appear if the first name written on the list is "Water" and I want to make the word "uff" appear if the first name written on the list is "Coffee".
I put the button "Change the first food" to change the fist name of the list.
I can write code, I like to write code, depending on who you ask I can very good at it at the same time I think I suck, and so would the world and it's okay.
Okay. So your main issues are that you're not using the correct properties for what you're trying to target.
let name = document.getElementById('food').value;
This line is failing because there is no value property for the getElementByID method. It's meant to be innerHTML if you want to retrieve the text value.
document.write(uff);
This here inside your else statement is also incorrect.
'uff' is a variable that has not been defined.
document.write will clear the entire screen and print out whatever arguments you've placed inside there.
What is it that you're ultimately trying to achieve? I can see a few issues within your script which causes things thing to not work properly.
What I want it to do is to make the image appear if the first name written on the list is "Water" and I want to make the word "uff" appear if the first name written on the list is "Coffee".
I put the button "Change the first food" to change the fist name of the list.
Okay. So your main issues are that you're not using the correct properties for what you're trying to target.
let name = document.getElementById('food').value;
This line is failing because there is no value property for the getElementByID method. It's meant to be
innerHTML
if you want to retrieve the text value.document.write(uff);
This here inside your else statement is also incorrect.
Here you can find a pen of more or less how it should look.