JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" >
<title>Sivun otsikko (näkyy selaimen palkissa)</title>
</head>
<body>
<input type="text" name="nimi" id="tekstikentta" />
<input type="button" value="Kysy ja aseta" onclick="kysyJaAseta();" />
<!-- ladataan JavaScript-koodit tiedoston lopussa! -->
<script src="javascript/code.js"></script>
</body>
</html>
JavaScript
function kysyJaAseta() {
var arvo = prompt("Kerros?");
document.getElementById("tekstikentta").value = arvo;
}