if($(window.location.hash).length>0){ setTimeout(function(){ $('html,body').animate({ scrollTop: $(window.location.hash).offset().top }, 500); }, 200); } function override_Ltv(){ console.log("LTV "); var property_value = $('input#Property_Value').val().replace(/,/g, ''); var deposit_required = $('input#Desposit_Amount').val().replace(/,/g, ''); var ltv = 100-((deposit_required/property_value)*100); // console.log(property_value); // console.log(deposit_required); ltv = ltv.toFixed(0); // console.log(ltv); if(ltv >= 0 && ltv < 100){ $('#LTV_Amount').text(ltv); $('#LTV_Amount_Input').val(ltv); $('#Submit_LTV').removeAttr('disabled'); } else { $('#LTV_Amount').text('0'); $('#LTV_Amount_Input').val('0'); //$('#Submit_LTV').attr('disabled',''); } } $('#Desposit_Amount, #Desposit_Amount').on('mouseover', override_Ltv);