Why is my Javascript not working?

It’s document.getElementById, not document.getElementbyId. (In JS, name of variables and functions are case-sensitive)

Debugging tip : Look at the JS console (F12 in Google Chrome and IE9, Ctrl+Shift+K in Firefox). In this case, following error can be seen:

It shows where the error happened (line 260 in your HTML/JS code) and what the error is(Object #<HTMLDocument> has no method getElementbyId).

Leave a Comment