Answer the question
In order to leave comments, you need to log in
How to display the entered text from the field immediately?
There is a field like
<input type="text" class="uk-input uk-form-width-small" name="summa" required pattern="^[ 0-9]+$" placeholder="Сумма" maxlength="6">
<span class="uk-text"></span>
Answer the question
In order to leave comments, you need to log in
You can use type="number"
instead of type="text"
, and you don't need a pattern, but you don't have to
document.querySelector(".uk-input").addEventListener("input", e => {
document.querySelector(".uk-text").innerText = e.target.value / 100
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question