I found a fiddle that logs when an input field changes value. However i would like to log the new value as well. I have tried all the combinations i found online, but cant get it to work. here is a fiddle: https://jsfiddle.net/XezmB/8/
index
<input type="number" id="n" value="5" step=".5"/>
script
$(":input").bind('keyup change click', function (e) {
if (! $(this).data("previousValue") ||
$(this).data("previousValue") != $(this).val()
)
{
console.log("changed");
$(this).data("previousValue", $(this).val());
}
});
$(":input").each(function () {
$(this).data("previousValue", $(this).val());
});