<h1>Кликни на блоки и получишь результат </h1>
<div id="first_topic">
  <div class="topic_info">
    <div class="topic_like_button">вот сюда будет навешан эвент</div>
  </div>
</div>

<div id="first_topic">
  <div class="topic_info">
    <div class="topic_like_button">и сюда будет навешан эвент</div>
  </div>
</div>

<div class="topic_like_button">а сюда нет</div>
body {
  font-size: 12px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: sans-serif;
  font-weight: 900;
}

h1 {
  margin:1rem;
  font-size: 1rem;
}

.topic_like_button {
  padding: 1rem;
  border: 1px solid #0005;
  width: 15rem;
  margin: 0.5rem;
  border-radius: .5rem;
  // font-family: sans-serif;
  font-weight: 100;
  text-align: center;
}
View Compiled
let element = document.querySelectorAll("#first_topic .topic_info .topic_like_button");

element.forEach(item => {
  item.addEventListener("click", () => {
    alert("тадам");
  });
});

document.querySelectorAll('.topic_like_button')[2].onclick = () => {
  alert("А вот хуй тебе, сюда тоже навешан эвент, ток другой");
} ;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.