L
L
LazariusPaskalius2020-04-26 10:32:42
JavaScript
LazariusPaskalius, 2020-04-26 10:32:42

How to set empty value for all inputs with the same class?

There are several inputs that have one common class, it is necessary that all entered values ​​in them be replaced by "". How can this be done in pure JavaScript without Jquery?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Nekrasov, 2020-04-26
@LazariusPaskalius

Maybe so?

document.querySelectorAll('input.класс').forEach(element => {
  element.value = '';
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question