The instructor (Jeff) will go over everything before showing you this page. Once you get here, you are on your own until someone wins the challenge. So, everything you need to know will be in this blog post.
Follow these steps:
- First, click here to get the StackBlitz template for this challenge
Once you have done this correctly, you should be able to type your name and a message into the input boxes and then hit RETURN and the message will be posted to everyone.
Here are a few hints:
- Remember that you first need to get a reference to the input box by using the
document.querySelector()function and passing in the name of the input class (i.e.
var myVariable = document.querySelector('.someClassNameHere');
- Once you have a reference to the input (you should have set it to a variable), then use the
addEventListener()function on that variable to assign the
onKeyUpfunction for the keyup event. It should look something like this:
- You should only have to enter two lines of code to make this work. The first line is using
document.querySelector()and the second line is using
Again, if you did this correctly, you should be able to type in a message into the input box, hit return and everyone should see it. Good luck!