xxxxxxxxxx
1
2
<html lang="en">
3
<head>
4
<meta charset="UTF-8">
5
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6
<title>文字表示</title>
7
</head>
8
<body>
9
<form id="htmlInputForm">
10
<label for="htmlInput">文字を入力してください:</label><br>
11
<textarea id="htmlInput" name="htmlInput" rows="4" cols="50"></textarea><br>
12
<button type="button" onclick="displayHTML()">表示</button>
13
</form>
14
<div id="displayArea"></div>
15
16
<script>
17
function displayHTML() {
18
var htmlCode = document.getElementById("htmlInput").value;
19
document.getElementById("displayArea").innerHTML = htmlCode;
20
}
21
</script>
22
</body>
23
</html>
24