$("input").change(function(){
alert("The text has been changed.");
});
$(document).on("input", "#payedValue", function () {
var mad = $("#madyoniya").val();
var payed = $(this).val();
$("#rest").val(parseFloat(mad) - parseFloat(payed));
});