Is it possible to disable double click on the entire site and on any element? Is it possible with jQuery or HTML? I want to prevent the user from giving 2 clicks in a row on links, buttons and etc.
Is it possible to disable double click on the entire site and on any element? Is it possible with jQuery or HTML? I want to prevent the user from giving 2 clicks in a row on links, buttons and etc.
You can disable the button
element eg. after click
and enable it again after 2 seconds (eg)
function myFunction(e) {
document.getElementById("linha").innerHTML += "<p>adicionado linha</p>";
//Desabilita o botao
e.disabled = true;
//Habilita novamente após dois segundos (2000) ms
setTimeout(function(){
toggleDisabled(e)
},2000);
}
function toggleDisabled(elem){
elem.disabled = !elem.disabled;
}
<p>Texto de testes</p>
<button onclick="myFunction(this)" id="btn">Clique</button>
<div id="linha"></div>