Skip to content

Conversation

njood8
Copy link

@njood8 njood8 commented Jul 6, 2025

function sayHello() {
alert("Hello from Absher 🎉");
}
document.getElementById("myForm").addEventListener("submit", async function (e) {
e.preventDefault();

const name = document.getElementById("name").value;

const response = await fetch("/api/hello", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ name })
});

const data = await response.json();
document.getElementById("response").textContent = data.message;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant