Three very important things: 1) You must publish your course to test JavaScript. It won't work in Preview mode. 2) When you publish, use the Developer mode in your browser (Ctrl+Shift+I in Chrome) to see if any error occurs. One little ";" missing can cause mysterious nothing on the screen unless you look at errors in developer mode. If there's a red error, it tells at least what's wrong.
3) Is optional but helps a lot. Your JavaScript ends up in a file /story_content/user.js. Why is it good for you? If you publish your file and it's not working, you can open that user.js and try to fix it there. Save it and reload the published version. This way, you don't need to rebuplish every time you try something. However, remember to fix it in your source too.
Welcome to the dark side;