// script.js
const openModalBtn = document.getElementById("openModalBtn");
const modal = document.getElementById("myModal");
const closeModal = document.getElementsByClassName("close")[0];
const updateValueBtn = document.getElementById("updateValueBtn");
const inputField = document.getElementById("inputField");
const popupInput = document.getElementById("popupInput");

// Abrir ventana emergente
openModalBtn.addEventListener("click", () => {
    modal.style.display = "block";
});

// Cerrar ventana emergente
closeModal.addEventListener("click", () => {
    modal.style.display = "none";
});

// Actualizar valor del input desde la ventana emergente
updateValueBtn.addEventListener("click", () => {
    inputField.value = popupInput.value;
    modal.style.display = "none";
});
