0
Form input value
Anybody help me i created a Interest Calculator but after submitting form i am expecting to Blank all my input fields of form i used input.value=" " but it didn't work for me.
2 Respuestas
+ 1
Could you please share the code with us? It will be easier to find the issue.
0
console.log("Script is working");
//let subBtn = document.getElementById('subBtn');
let fSubmit = document.getElementById('fSubmit');
//Making function for getting Calculation of Interest
fSubmit.addEventListener('submit', function(e) {
e.preventDefault();
let pRate = document.getElementById('pRate').value;
let Interest = document.getElementById('Interest').value;
let Year = document.getElementById('Year').value;
let h1 = document.querySelector('h1');
let simpleInterest = (pRate*Interest*Year)/100;
h1.innerHTML = "The interest is: "+ simpleInterest;
console.log(simpleInterest);
pRate.value = " ";
Interest.value = " ";
Year.value = " ";
});