I'm familiar with Javascript but not all that good at debugging it, so the first thing i do is try and isolate the code (normally using W3 School's Try-It editor)

Upon doing so and narrowing the...