how to disable button in javascript onclick code example Example: javascript disable button document.getElementById(BUTTON_ID).disabled = true;