The onclick event, in fact, is not just a mouse click event, in fact, for users who use the keyboard can also trigger the event, such as the TAB key to move the connection, press the ENTER key can also trigger the OnClick event
So in the actual code programming process, if you consider using the onkeypress event to be careful, this means that the user every press of a button will trigger it.
When looking at this chapter of code optimization, I think that many times the bug in the program appears, perhaps the thinking is not strict, not rigorous caused by the loopholes.
However, in the actual development process, we can not think of every point, because sometimes the demand will not give you so much time, so often the first online, and then patched (of course, if the time is sufficient, it is best not to do so);
JS DOM Programming Art--picture library optimization--JS study notes 2015-7-11 (82nd Day)