I do a fair bit of javascript work - most of the time I just use google if I'm unsure. For example, yesterday I needed a script to check that a field had a "time" entered in a certain format.
A google like:
javascript validate time - Google Search
returns a lot of useful hits and you'll usually find a lot of js code that can be used from there.