JS Udemy course exercise

Hello there. I’d like some help on a recent assignment on a Udemy course. Here are the instructions and what I need to do.

Udemy Event Exercise

And here is my code so far:

const h1 = document.querySelector('h1');
const h2 = document.querySelector('Welcome, ');

input.addEventListener('change', function (e) {
     h1.innerText = input.value;
})

The Udemy editor doesn't like where I put "Welcome, ". I have the basics. I appreciate the help.

No one lol. That’s my attempt to add the "Welcome, ". I’ll be honest, at least 75% of why I don’t have a job in software yet is my ADD and inability to read instructions well enough.

Fair enough. I also think it just wants me to change the parameters of the H1 but I think I’m wrong on that too lol.

Yes, I think for the 3rd task I need prevent.default. I think lol

Here is the starting HTML source code…


<head>
    <title>Input Event</title>
    <!--LEAVE THESE LINES ALONE, PLEASE! THEY MAKE THE LIVE PREVIEW WORK!-->
    <script src="node_modules/babel-polyfill/dist/polyfill.js" type="text/javascript"> </script>
    <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>

</head>

<body>
    <h1>Enter Your Username</h1>
    <input type="text" id="username">
</body>

</html>

Yes I’m over thinking it lol. Another “noob” trait I’m trying to get through.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.