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

JavaScript

Form Validation and Manipulation

I just spent over and hour trying to do the second part of the code challenge in the "Text and Inputs" section...

"Select all inputs and on the 'keydown' event select 'this' and then show the next element."

I tried and tried to do this on my own but just basically got angry and looked up the answer online which was this...

$(document).ready(function(){ $('.hint').hide(); }); $('input').keydown(function(){ $(this).next().show(); });

Now from the tutorial video that I watched (about 14 times) How on earth would I EVER come up with that answer?

I am taking the Become a Web designer" adventure and now have 39 or so badges but I am feeling extremely let down in the Coding sections like Javascript Foundations which I have completed but feel I didn't really learn anything. Why? Because there are NO practical application samples. Jim goes on and on about variables, strings, etc. but NEVER shows you a practical application in how this 'Variable' or that 'String' may be used on a website. Beginners need to see what the code may be used for to understand it otherwise you might as well be speaking in foreign tongues. It is too bad because I think Jim is actually the best speaker you have.

4 Answers

Programming and designing are quite different.

I tend to think JavaScript is a terrible first language. IMHO, I think your first language should be with Ruby or Python.

My suggestion for someone new to programming is to read Learn to Program to learn Ruby and supplement with codecademy's code challenges.

Alternatively you can check out Learn Python the Hard Way and supplement with codecademy's code challenges.

If you want another resource to learn JavaScript, codecademy has some great exercises for that as well.

Thanks James I have already started at Code Academy and it is very easy to follow. I have actually been a web designer for 16 years but have always farmed out the coding. I have recently lost the guy that I trust to do it for me so I am determined to learn this on my own.

Milo - $(document).ready isn't really needed in this instance.

Try: $('.hint').hide(); $("input").keydown(function(){ $(this).next().show() } );

I'm in the same boat as you Milo, I've been working as a Web Designer and Graphic Designer for over a year now, but never tried to learn to code.

JQUERY seems quite confusing but I did find this absolutely awesome tutorial video which helped me ten fold.

http://www.youtube.com/watch?v=Hk5oXFtYLwE