DenKuzmin17,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.slider-pagination{
display: flex;
justify-content: center;
}
[data-id]{
background-color: hsl(236, 77%, 45%);
height: 18px;
width: 18px;
border-radius: 50%;
margin: 12px;
line-height: 18px;
text-align: center;
color: hsl(0, 0%, 100%);
}
[data-id]:hover:after{
content: attr(data-id);
font-size: 12px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
const slider = $("#slider"),
length = slider.find('.slide').length,
html = Array.from({length}, (v, k) => `<div class="slider-point" data-id="${++k}"></div>`),
parent = slider.parent().append('<div class="slider-btn previous"></div><div class="slider-btn next"></div><div class="slider-pagination"></div>');
$(".slider-pagination", parent).append(html)
});
</script>
</head>
<body>
<div id="box">
<div id="slider">
<div class="slide">1</div>
<div class="slide">2</div>
<div class="slide">3</div>
</div>
</div>
</body>
</html>