i have a template with repeating blocks , the idia is to toggle closet .products\_block every time when i click on .id\_name , how can i do it ? For instance if i will click on third .id\_name i want to toggle only third .products\_block.

i catch the elements 

```
const elem  = document.getElementsByClassName('id_name');
const prod  = document.getElementsByClassName('products_block');

```

make an arrays 

```
const elemArray = Array.prototype.slice.call(elem)
const prodArray = Array.prototype.slice.call(prod)

<div class="id_name">
     <p>onlcik</p>
     <div class="products_block">
         <p>show</p>
     </div>
 </div>

<div class="id_name">
     <p>onlcik</p>
     <div class="products_block">
         <p>show</p>
     </div>
 </div>

....

```