Javascript examples for DOM:Mouse Event
The detail property returns how many times the mouse was clicked.
This property is read-only.
A Number, representing the number of clicks.
The value for a ondblclick event is always "2"
The value for a onmouseover or onmouseout event is always "0".
The following code shows how to find out how many times the mouse was clicked.
<!DOCTYPE html> <html> <body> <button onclick="myFunction(event)">Click me to count</button> <input id="myInput" type="text"> <script> function myFunction(event) {//from w w w .j a va 2s . co m var x = event.detail; document.getElementById("myInput").value = x; } </script> </body> </html>