A list of bad things which have gained common use


A remnant from before event handlers were introduced, and a handy tool for executing test scripts in the address bar, this piece of code has somehow not only survived in its original incarnation as a means of producing javascript-generated pages, which quickly lead to its use as as a hack to run scripts on link clicks, but it has expanded into being used in event handlers.

javascript: has nothing whatsoever to do in an event handler, as for its original use, you should use the onclick event handler.


While not wrong in itself, this little function can cause lots of problems and wreak total havoc in the hands of the inexperienced. This is a function you really need to know what you are doing to use correctly. Usually, you would want to use innerHTML instead.


OK, so this one is not entirely bad (just a bit), but it is being horribly overused.

document.getElementById() is not a very efficient method, and in many cases there are more efficient ways of getting an object reference, usually the various collections available on a page.