. Advertisement .
..3..
. Advertisement .
..4..
Hi there! Anyone have any ideas to Prevent Double Click in Jquery? My project is stuck at this place and it takes me quite a while. If anyone has faced similar situation, please give me suggestions. Thank you!
The preventDefault() method is used to cancel the event when it’s cancellation-able, which means it is a default event which is tied to the event won’t take place. This can be beneficial for situations such as:
- By clicking on the “Submit” button, you can block the form from being submitted
- When you click on a link, stop that link from accessing the URL
Syntax:
event.preventDefault()
Here is example:
$(document).ready(function() {
$(window).keydown(function(event){
if(event.keyCode == 13) {
event.preventDefault();
return false;
}
});
});
Hope it works for you
There is a simple solution