There are many great online options that will teach the syntax of coding:
Codecademy - They have a great resource that is free. I recommend going through the HTML and CSS lessons early on as later on sometimes the lessons can seem a bit trite. Additionally, the system can be a bit buggy as it is a software that is supported by other donated time. Even though it is understandable, as a beginner, it can be frustrating when it is not working due to the bug.
Code School - They are not cheap, however they provide a valuable resource. I have found that there are some tutorials that do not work for me in this type of setting. I think depending on the subject the format they use may not be the best option for me to learn.
All these resources our great. However, I would find times where both can be frustrating as they would not take into account an alternate way to solve a problem. I found myself often using jsfiddle to double check the solution that I came up with. This and similar tools will allow you to also debug the code better than the editors and the error messages that the Codecademy and Code School interfaces give.
I also feel that they lack the process to start moving you in a direction to do your own projects. Sandboxes are fine for starters, but there comes a time where you want to make something on your own machine. These options don’t really prepare one for the next step.
I think they are valuable resources, but they should be left behind after a couple months in favor for real projects on your own machine.