Files
PIbd-21_Kudrinsky_O.S._IP/scripts.js

31 lines
911 B
JavaScript

import ProductController from "./components/Product/ProductController.js";
const API_URL = "http://localhost:3001";
const root = document.getElementById("product-root");
new ProductController(root, API_URL);
document
.getElementById("refund-form")
.addEventListener("submit", function (event) {
event.preventDefault();
const email = document.getElementById("email").value;
const reason = document.getElementById("reason").value;
const refundCard = document.createElement("div");
refundCard.classList.add("col");
refundCard.innerHTML = `
<div class="card">
<div class="card-body">
<h5 class="card-title">Возврат для ${email}</h5>
<p class="card-text">Причина: ${reason}</p>
</div>
</div>
`;
document.getElementById("refund-container").appendChild(refundCard);
document.getElementById("refund-form").reset();
});