I managed to perform a function on the first click
function s(){
$('div').addClass('s');
$('div').css({display:"block"});
console.log("click");
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button onclick="s()">Haz Click!</button>
But I don't know how to detect the second click
you can set a variable
clics
and from there you can determine how many clicks the user is making on that buttonFor a double click event you can use this:
Cheers
listenners have a function called
dblclick
, an example using click and double click, you must be careful with this I recommend you use one or the other to avoid confusion