I want to create a button that gets disabled after one click/is just clickable one time... I couldnt find anything about it.
Add a click event listener to the button which disables it.
document.querySelector('button').addEventListener('click', function(){ this.disabled = true; })
<button>Button</button>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.