Perhitangan menggunakan Javascript

Discussion in 'Desain Web dan Programming' started by Ilhamikaze, 14 Oct 2016.

Thread Status:
Not open for further replies.
  1. Ilhamikaze

    Ilhamikaze Beginner 1.0

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Bagaimana melakukan perhitungan pengurangan antara finish dikurangi dengan start jika formatnya seperti digambar

    Mohon bantuannya Tuan :)

    <script>
    function sum() {
    var txtFirstNumberValue = document.getElementById('emp_start').value;
    var txtSecondNumberValue = document.getElementById('emp_finish').value;
    var result = parseInt(txtSecondNumberValue) - parseInt(txtFirstNumberValue) - 8;
    if (!isNaN(result)) {
    document.getElementById('emp_total').value = result;
    }
    }
    </script>
     

    Attached Files:

Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...