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 trialAbdullah Howard
11,955 PointsCannot read property, 'username' of undefined
I'm trying to create a program where a user will enter their usename and password and and an object will be instantiated with those two values. That part works fine. Once he hits submit he is taken to another page where he can click two buttons. One that shows his username and one that shows his password. When I click the buttons I get "dom_events.js:40 Uncaught TypeError: Cannot read property 'username' of undefined"
Could someone please take a look at my code and tell me where i went wrong? I appreciate the help
1 Answer
Uche Onuekwusi
18,070 PointsYou are selecting the button instead of the form. your event listener should listen for for form submission
Abdullah Howard
11,955 PointsAbdullah Howard
11,955 PointsI tried that and it still returns undefined.