Answer the question
In order to leave comments, you need to log in
How to get its old value when input is changed?
Actually, there is an input that changes. Getting a new input value is not difficult, but I can’t figure out how to get the old value that was before entering the new one. Maybe some other event should be used?
var price = $('#product-price').val(),
width = $('#product-width').val();
$('#product-footage').keyup(function(){
var footage = $('#product-footage').val();
//
});
Answer the question
In order to leave comments, you need to log in
you can store the previous value in the data attribute when you get focus on the element.
implementation example
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question