Percentage Calculator Online

 




var form = document.getElementById('xIsWhatPercentOfY');

form.addEventListener('submit', function(event){ var x = parseFloat(numField1.value); var y = parseFloat(numField2.value);

var result = x / y; var percent = result * 100;

resultField.innerText="Precentage: "+ percent+ "%"; event.preventDefault(); });