JavaScript click events executing twice.

2010-09-09
2013-04-29
  • Stephen Foster
    Stephen Foster
    2010-09-09

    If I navigate to a local html file containing the following code,

    <div onclick="alert('hi')">Test</div>,

    clicking "Test" often (but not always) results in two alert boxes being created.  Why does this happen?  (It doesn't in other major browsers.)