I’m trying to disable click on the button on the page before the page fully loads. I’ve tried the code below, which should active the click for a particular element when the page is loaded:
<script>
$(document).ready(function() {
$("div#wc-proceed-to-checkout").click(function () {
launchAction();
});
});
</script>
Alternative solution – disable click for the whole page until the page fully loads.
2
Answers
You can try using the disabled attribute on button to disable it.
https://www.w3schools.com/tags/att_button_disabled.asp
and once the page loads remove the attribute
using –
removeAttr('disabled') method
Your script:
The HTML element must have disable true, or you can