I have this jquery function:
$(function() {
$('.submitButton').click(function(){
$('input').each(function() {
if ($(this).attr('min')) {
if ($(this).val()<$(this).attr('min')){
$('#'+$(this).attr('id')+"_errMess").prepend(' Your data should be more than '+$(this).attr('min'));
}
}
});
});
});
It seems that it checks only the first digit entered in the input. because for example when the value of 'min' attribute is 7, and the value entered in input is 10, it shows the error message (the if condition is true!!). although when i want it to alert value, it seems it knows the true and total value and returns 10.
alert($(this).val());
Can you please help me understand what is wrong?