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 trial
Farnoosh Johnson
7,887 Pointselement[].value
what does "var element = document.getElementById('IDNAME');" "var num = element.elements[0].value;" do? I dont understand the part "element[0].value? and why it is an array?
2 Answers
Maureen O'Neal
12,930 PointsFirst, would you share the question and the code, together? And maybe what class it was for? :)
Farnoosh Johnson
7,887 Pointsit's just a self study for ping pong test.
when I want to ask user to enter a number and I want to restore the number in a variable that change the sting to an integer. I see that people dont use ParseInt(), and they just use element[].value