Stuck with a simple Javascript code.

How come I am not just selecting the .li elements on app.js? what am I missing?

index.html

<!DOCTYPE html><html><head><title>JavaScript and the DOM</title></head><linkrel="stylesheet"href="style.css"/><body><section><h1>Making a Webpage Interactive</h1><p>JavaScript is an exciting language that you can use to power web servers, create desktop programs, and even control robots. But JavaScript got its start in the browser way back in 1995.</p><hr><p>Things to Learn</p><ul><li>Item One: <inputtype="text"></li><li>Item Two: <inputtype="text"></li><li>Item Three: <inputtype="text"></li><li>Item Four: <inputtype="text"></li></ul><button>Save</button></section><scriptsrc="app.js"></script></body></html>

I also spent a lot of time on this and thought that it should work, there is one small detail that I think is not discussed during the course. tagName returns an element's value in capitalized letters so when you put "input" after "==" in if condition it has to be capitalized: "INPUT" , otherwise it won't work. That's also why during the course "LI" was capitalized.

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.