I'd suggest using Opera or Firefox (or both) to test your javascript, because they give less vague error messages in their error consoles. In this case opera tells me "message: Statement on line 10: Reference to undefined variable: getElementById", which means that there's no such thing as getElementById in scope. What you're looking for is document.getElementById, it's a method of the document object rather than a global function.