I have below jquery if\else comparison to evaluate part of code based on results,
if($('#order_quantity').val() < $('#available_quantity').val()) {
// ---code to run----
} else {
// --- code to show error---
}
This code work 3-4 times correctly for inputs and after that it working wrong,
when $('#order_quantity').val() = 5
and $('#available_quantity').val() = 46
, then ideally --code to run-- should execute but it is running --code to show error -- of else statement.
Sometimes it correct and sometimes it not, I created console.log
for above input values, inputs are correct but still comparison results throw wrong results
What can be problem in this comparison?