customize template
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
fetch('/message')
|
||||
.then((resp) => resp.text())
|
||||
.then((text) => {
|
||||
const h1 = document.getElementById('heading')!;
|
||||
h1.textContent = text;
|
||||
});
|
||||
|
||||
const button = document.getElementById("button")!;
|
||||
button.addEventListener("click", () => {
|
||||
fetch('/random')
|
||||
.then((resp) => resp.text())
|
||||
.then((text) => {
|
||||
const random = document.getElementById('random')!;
|
||||
random.textContent = text;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user