Dan wrote:
How do I catch both ondblclick and onclick on a div?
By putting both events on the div - trivial example:
<div onclick="document.getElementById('cc').innerHTML = 'You clicked';"
ondblclick="document.getElementById('cc').innerHTM L =
'<b>you double clicked</b>';">the result: <span id="cc"></span></div>
However, the first click will execute the "onclick", so if the double
click gets through (as it does in my example) both events will fire
unless the first click does something that immediately causes all
further input to be ignored - say opening a modal dialog like alert.
I can't think of how a double click could get through before the first
single click - but I'm happy to be enlightened.
Fred.