The other comments in the thread seem to tell you to use a framework, and that's great advice. But you need to learn plain javascript first. You say you've mostly done PHP, so there are some programming concepts that are essential in javascript that you haven't been exposed to, namely functional programming. So, learn a bit about functional programming, then get a javascript book (the oreilly one is good), and read that. Then you'll know the basics and can use a framework to abstract away some of the tedium.