I feel i stuck on this, I need somebody to help me out please

<p>Input Event Practice

It's time to practice working with the **input event**! In the index.html file, you'll find an `<h1>` and an `<input type="text">` element. Please do not change anything in index.html! In `app.js`, write code that meets these requirements:

* The h1 should start with the text "Enter Your Username" (I've done that for you, already in the markup)
* Whenever an `input event` is fired on the `<input>` element, update the `<h1>` so that it displays "Welcome, " plus the current value from the text input. Take a look at the gif below to see how it should work.
* If the `<input>` goes back to being empty, update the `<h1>` so that it once again says "Enter Your Username"
The below of this instruction is my code. <p/>
const input = document.querySelector('input');
const h1 = document.querySelector('h1');
input.addEventListener('input', function(e){
    h1.innerText = input.value;`Preformatted text`

Can you provide your code with triple backticks like this?


paste code here


<!DOCTYPE html>

    <title>Input Event</title>
    <script src="node_modules/babel-polyfill/dist/polyfill.js" type="text/javascript"> </script>
    <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>


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



I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Thank you for making me aware of this issue. :slight_smile:

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