how to calculating input value with tap on keyboard | بلاگ

how to calculating input value with tap on keyboard

تعرفه تبلیغات در سایت

آخرین مطالب

امکانات وب

Vote count: 0

i have 5 input tags







$(".value").keydown(function(event){
        var ok = 48;
        var it = 57;
        if(event.which>=ok && event.which<=it || event.which==8){

        }else if(event.which==9){

        var num1 =parseInt($("#num1").val());
        var num2 =parseInt($("#num2").val());
        var num3 =parseInt($("#num3").val());
        var num4 =parseInt($("#num4").val());

            if(num1 && num2){
                $("#num3").html(num1+num2);
            }
            else if(num3 && num4){
                $("#num5").val(num3+num4);//on this line it's not showing the value, i dont know what it's going on
            }
        }else{
            event.preventDefault();
        }
});

if i input value on #num1 and #num2, then i press "tab" on keyboard, result is showing on #num3, it's done, but, if i input on #num4,then i press "tab" on keyboard,it's not showing on #num5

asked 57 secs ago
Dio Satria Darma

...
نویسنده : استخدام کار بازدید : 20 تاريخ : چهارشنبه 9 اسفند 1396 ساعت: 7:18