document.addEventListener("submit", function (e) {
const form = e.target;
if (true) {
document.querySelector('.form-wrap').innerHTML = "Новая форма"
}
fetch("/" + formname, {
method: "post",
body: new FormData(form),
})
.then((res) => res.json())
.then((res) => {
if (res.status) {
form.reset;
}
})
})