fcsm_andrei,
вы что-то не договариваите.
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.row {
height: 40px;
border: 4px solid #0000CD;
margin: 4px;
}
body{
counter-reset: num 0;
}
.row:before{
counter-increment: num ;
content: counter(num);
line-height: 40px;
}
</style>
</head>
<body>
<div class="keyboard"></div>
<script>
const keyboard = document.querySelector(".keyboard");
const row = [];
for(let i=0; i<5; i++) {
row[i] = document.createElement('div');
row[i].classList.add('row');
keyboard.appendChild(row[i]);
}
</script>
</body>
</html>