Q:

Auto calculator when fill two number

I have 3 different fields:

Field 1: fill date of birth
Field 2: fill date of death
Field 3: age

After, I fill full field 1 and 2, I want to calculate age follow date of death and date of birth and auto filled field 3.  Example:

Field 1: i fill : 2003/02/26
Field 2: i fill : 2019/06/20
Field 3: auto fill : 16

A:

You can use this sample code though inputs are not validated, it is just for your understanding. 
<! DOCTYPE html>
<html>
<head>
<title>Date Difference</title>

</head>
<body>
<label>Start Date</label>
<input type="text" id="start" onkeyup=calculateYears()>

<label>End Date</label>
<input type="text" id="end" onkeyup=calculateYears()>

<label>Years</label>
<input type="text" id="years" onkeyup=calculateYears()>

<script>
function calculateYears(){
    //convert start and end inputs into date object
    var start = new Date(document.getElementById('start').value);
    var end = new Date(document.getElementById('end').value);

    //calculate difference in milliseconds
    var diff = new Date(end - start);

    // convert milliseconds into years.  I hope that part is not to be taught to you. 

    var years = diff/1000/60/60/24/365;

    //set value of years input box
    document.getElementById('years').value = Math.round(years);
}
</script>

</body>
</html>

