use jquery in dobounce injquery code example
Example: jquery debounce
$(".my-btn").click($.debounce(250, function(e) {
console.log("It works!");
}));
$(".my-btn").click($.debounce(250, function(e) {
console.log("It works!");
}));