How do I make the button disabled after clicking?
-
There is a button like this:
<input class="btn btn-info btn-block" id="submit" name="submit" type="submit" value="Продолжить">
How can I make it disabled when clicked, and the text "Continue" changed to "Please wait", please tell meJavaScript Anonymous, Nov 15, 2019 -
Anonymous
-
const button= document.querySelector('.form_button')
button.addEventListener('click', function(e) {
this.textContent = 'Подождите пожалуйста'
this.setAttribute('disabled', 'true')
})Clare Olson
2 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!