I am extremely new to JavaScript and have no idea how to fix this. Right now if you click the submit button you'll get a the alert message but then when you close it all the entries are still there.
function contactform(){
var fname = document.getElementById("fnameinput");
var lname = document.getElementById("lnameinput");
var email = document.getElementById("emailinput");
var phone = document.getElementById("phoneinput");
fname.value && lname.value && (email.value || phone.value) ? alert
("Thank you, " + fname.value + " " + lname.value + "\n"
+ "We will get back to you shortly!") : alert ("Please fill in all fields.");
}
document.getElementById("submit").addEventListener("click", contactform, false,);
I want the entire page to reload after clicking the submit button.