<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Пример</title>
</head>
<body>
<input type="text" id="a" class='input' value="60" />
<input type="text" id="b" class='input' value="0" />
<input type="text" id="c" class='input' value="0" />
<input type="text" id="d" value="0" />
<script>
window.onload = function(){
var inp = document.querySelectorAll('.input');
for(var i = 0; i < inp.length; i++){
inp[i].oninput = calc;
}
function calc(){
a = document.getElementById('a').value;
b = document.getElementById('b').value;
c = document.getElementById('c').value;
d = (a-b-c)/(a-b)* 100;
document.getElementById('d').value = d ;
}
}
</script>
</body>
</html>