-
Notifications
You must be signed in to change notification settings - Fork 0
/
result.html
executable file
·63 lines (60 loc) · 1.38 KB
/
result.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>お問い合わせの入力内容</title>
<style>
#result {
border: 1px solid #cccccc;
border-collapse: collapse;
width: 100%;
max-width: 800px;
}
th, td {
padding: 0.5em;
border: 1px solid #cccccc;
text-align: left;
vertical-align: top;
}
th {
width: 100px;
background-color: #eeeeee;
}
</style>
</head>
<body>
<h1>お問い合わせフォームの入力内容</h1>
<table id="result">
<tbody id="test">
<tr><th>name属性</th><th>入力された内容</th></tr>
</tbody>
</table>
<p><a href="contact.html">←お問い合わせフォームに戻る</a></p>
<script>
'use strict';
{
window.addEventListener('DOMContentLoaded', function(){
var params = decodeURI(location.search);
params = params.substring(1);
var paramArray = [];
paramArray = params.split("&");
var tableContent = "";
paramArray.forEach(function(item, index){
var keyValue = [];
keyValue = item.split("=");
var tr = document.createElement("tr");
var tdName = document.createElement("td");
tdName.textContent = keyValue[0];
var tdValue = document.createElement("td");
tdValue.textContent = keyValue[1];
tr.appendChild(tdName);
tr.appendChild(tdValue);
var e = document.getElementById("test");
e.appendChild(tr);
});
});
}
</script>
</body>
</html>