document.addEventListener("DOMContentLoaded", () => { const app = alpinejs(); const scooby = { title: "Scooby-Doo", image: "../assets/scooby.jpg", }; app.init({ state: { scooby, }, func: { onSubmit(key) { // Code to create the image goes here console.log("Submitted!"); }, }, }); });