Also I disagree somewhat with his onclick mention: onclick is for both mouse and keyboard anyway. onkeypress (and for more browser compatibility I use onkeyup) is more like onmouseup/down, or when you have built some form controls and need to separate out the user moving around from actually selecting it).