Hi semua…
Saya mohon bantuannya untuk kendala di Skillpath no. 10, saya sudah mencoba beberapa kali tapi masih dinyatakan salah (Output: Unspecified AssertionError).
Berikut coding nya…
function submit(event) {
event.preventDefault();
const formData = {
name: document.getElementById("name").value,
city: document.getElementById("city").value,
email: document.getElementById("email").value,
zipCode: document.getElementById("zip-code").value,
status: document.getElementById("status").checked
};
const isValid = validateFormData(formData);
const warningDiv = document.getElementById("warning");
if (!isValid) {
warningDiv.textContent = "Periksa form anda sekali lagi";
} else {
warningDiv.textContent = "";
}
}
document.getElementById("myForm").addEventListener("submit", submit);