Pavel_16,
страница рекордов
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
table{
border: 1px solid #000000;
border-collapse: collapse;
}
td{
border: 1px solid #000000;
}
</style>
<script>
document.addEventListener( "DOMContentLoaded" , function() {
if (localStorage.getItem("users") === null) {
localStorage.setItem("users", JSON.stringify([]));
}
let users = JSON.parse(localStorage.getItem("users"));
let userName = localStorage.getItem("userName");
let time = localStorage.getItem("time");
if(time) {
users.push({userName, time});
localStorage.setItem("users", JSON.stringify(users));
localStorage.removeItem('time');
}
let html = ''
for (const {userName, time} of users) html +=
`<tr>
<td>${userName}</td>
<td>${time}</td>
</tr>`;
document.querySelector('table tbody').innerHTML = html;
});
</script>
</head>
<body>
<table>
<thead><tr>
<td>имя</td>
<td>время</td>
</tr>
</thead>
<tbody></tbody>
</table>
</body>
</html>