AOC_2022/5/tuer5.html

34 lines
907 B
HTML

<!DOCTYPE html>
<body>
<h3>Input-File: </h3><input onchange="readFile(this)" type="file">
<button id="start">pwess mee! UwU~</button>
<hr>
<h3>Output:</h3>
<p id=output>OwO Mastaaw, I dow't like bewwing in a webbwosaaww!! I feew dizzy.. -o- Anyway hewe's youww numbaaw UmU~ :</p>
</body>
<script>
let output = document.getElementById("output");
let input;
function readFile(input) {
let file = input.files[0];
let fileReader = new FileReader();
fileReader.readAsText(file);
fileReader.onload = function() {
input = fileReader.result;
};
fileReader.onerror = function() {
alert(fileReader.error);
};
}
let start = document.getElementById("start");
start.addEventListener("mouseover", () => {
start.innerHTML = "pwease pwess mee hawwd mastaaa! UwU~"
});
start.addEventListener("click", () => {
alert(input);
});
</script>