If you find yourself stuck while writing code, remember to be patient. If you haven't already, try breaking your problem down into smaller, more manageable parts. Search Google or Stack Overflow for how to solve those parts, one at a time. Remember that most of the time you spend writing code will be fixing bugs. (And sometimes bugs will allow you to discover something new you haven't ever seen before!)
However, if you reach a point in which you absolutely need help and must ask another human, please considerately phrase your code question in the form of a jsFiddle. (To do this, type your code in the appropriate boxes and press "Run". Once it looks right, press "Save". Copy and paste the URL at the top.) In an email, explain everything you know so far about the problem and paste the link to the jsFiddle.
Interactive 2 by Will Ruby, CCA