Black_Star,
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#element1 {
width: 150px;
height: 150px;
margin: 10px;
background-color: red;
display: block;
}
#element2 {
width: 150px;
height: 150px;
margin: 10px;
background-color: green;
}
.redCircle{
width: 50px;
height: 50px;
border: 1px solid white;
border-radius: 50%;
background-color: red;
font-size: 1.5em;
text-align: center;
vertical-align: middle;
color:white;
display: none;
}
.greenCircle {
width: 50px;
height: 50px;
border: 1px solid white;
border-radius: 50%;
background-color: green;
text-align: center;
vertical-align: middle;
font-size: 1.5em;
color:white;
}
.Buttons.active .redCircle {
display: block;
}
</style>
<title></title>
<script>
window.onload=function(){
var buttonClick = document.getElementsByClassName('Buttons');
var redCircle = document.getElementsByClassName('redCircle');
var greenCircle = document.getElementsByClassName('greenCircle');
// Реализация событий по клику мышки
for (var i=0; i< buttonClick.length; i++){
buttonClick[i].onclick= function() {
this.classList.toggle("active")
};
}
}//]]>
</script>
</head>
<body>
<div class="Buttons">
<div id="element1">
Button1
<div class="redCircle">1</div>
<div class="greenCircle">2</div>
</div>
</div>
<div class="Buttons">
<div id="element2">
Button2
<div class="redCircle">3</div>
<div class="greenCircle">4</div>
</div>
</div>
</body>
</html>