Answer the question
In order to leave comments, you need to log in
block input?
Good afternoon, not very selenium can anyone help. There is a user page, when he entered information in the input and clicked save, then the input should be blocked. According to the idea, if the input is filled, then the blocking, if empty, then you can enter data.
Answer the question
In order to leave comments, you need to log in
HTML
<form>
<input required>
<button>Сохранить</button>
</form>
const form = document.querySelector('form');
const input = form.querySelector('input');
form.addEventListener('submit', (event) => {
event.preventDefault();
input.disabled = true;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question