Answer the question
In order to leave comments, you need to log in
Why doesn't the value in input change as you type?
Good day, please tell me what could be the problem, when I enter the input, I can not get the value.
I output to the console there something like this
id is unique, this is 100% I checked, it was not me who made it up.
The first time is that I can not get value
Maybe someone faced such a problem?
The site itself can be viewed at nakrutka.bz
Thank you all in advance
Answer the question
In order to leave comments, you need to log in
There are two elements on the page with the same id . Your script picks up and listens to the first one, and the user interacts with the second one, which your script doesn't listen to. Apparently, the peculiarities of the work of the vendor library. Add a class, for example f1 and fetch from it, and get the value from e.currentTarget :
$('.f1').on('change', function(e) => {
var value = $(e.currentTarget).val();
})
$(document).find('.form-element').on('change', e => console.log($(e.currentTarget).val()));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question