Check for mime-type and JS fun

This commit is contained in:
2025-03-20 10:54:54 +01:00
parent 704a03be3d
commit a9185aa868
5 changed files with 121 additions and 84 deletions

View File

@ -3,8 +3,12 @@
<head>
<meta charset="utf-8">
<title>http-server</title>
<script src="main.js" async></script>
</head>
<body>
<h1>Hello, World!</h1>
<button type="button" id="click-me">Click Me!</button>
<div id="output"></div>
</body>
</html>

9
www/main.js Normal file
View File

@ -0,0 +1,9 @@
document.getElementById("click-me").addEventListener("click", function() {
let output = document.getElementById("output");
if (output.innerHTML != "") {
output.innerHTML = ""
} else {
document.getElementById("output").innerHTML = "Wow! This actually works.";
}
});