arshia mohammadi

arshia mohammadi

What's this challenge answer?!

In the listener that has been added to the section element, ensure that the text input elements are the only children that trigger the background-changing behavior.

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>

1 Answer

Probably the easiest way to solve this challenge is to wrap the assignment statement in a conditional ("if") that tests what kind of element triggered the event. The "tagName" property of the event target should be "INPUT". It's not necessary to also check the type since all the input elements are text inputs.

arshia mohammadi

7,657 Points

arshia mohammadi

arshia mohammadi

The whole point of the challenge is to give you the experience of writing the code. Give it your best shot, and if you still have trouble passing the challenge, post the code you've added here and we can give you some more specific pointers for fixing it.

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