Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialerika harvey
Courses Plus Student 14,540 Pointsdoes not show up on for the manipulating the dom
what am i doing wrong. I've done what the example shows and it still isn't showing up in the console.
const form = document.getElementById('registrar');
const input = form.querySelector('input');
form.addEventListener('submit',(e) => {
e.preventDefault();
console.log(input.value);
}
x
7 Answers
erika harvey
Courses Plus Student 14,540 Pointsthat was it. they don't have the app.js file linked in the html page.
erika harvey
Courses Plus Student 14,540 Pointsokay , so i investigated the html page and it seems that it does not come with the link to the javascript file. i'm going to try and hook that up and see if it works then .
Benjamin Larson
34,055 PointsLooks like you maybe forgot to close the addEventListener function with a closing parenthesis and semi-colon?
const form = document.getElementById('registrar');
const input = form.querySelector('input');
form.addEventListener('submit',(e) => {
e.preventDefault();
console.log(input.value);
});
erika harvey
Courses Plus Student 14,540 Pointsoh yeah, no..i'm sorry that is the fault of my . bad copy and pasting effort. they are actually already closed properly..
Benjamin Larson
34,055 PointsI see you added a screenshot there but it's not displaying. Does anything happen in the console when you hit the submit button? I copied and pasted your code into my Workspace and it worked fine.
erika harvey
Courses Plus Student 14,540 Pointsnothing happens in the console. I tried using the debugger in the dev tools and its not showing as anything being wrong. let me try and upload my screen shot again. example link That should link you to my screen shot of the http responses I was getting back
Benjamin Larson
34,055 PointsIt does seem odd. Unless someone else has insight, I'd probably need to fork the workspace to see what's going on.
erika harvey
Courses Plus Student 14,540 Pointsthanks, and thank you for also being confused because it helps to know that i'm not truly not going insane.
Rod Sanati
Full Stack JavaScript Techdegree Graduate 20,177 PointsThank you! I couldn't see where I was going wrong. Just isn't linked by default.
Aleksandar Terziev
6,406 Pointsdelete the text/javascript type in the <script> element.