title: Hide or reveal div according to JSON data id
body: <p>I would like to know how to add a javascript snippet to my code, to reveal or hide a div according to the category ID my Json returns</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div id=&quot;community-members-member-content-categories-container&quot;&gt;
    &lt;div class=&quot;community-members-member-content-category page-text9&quot;&gt;
      Romantic
    &lt;/div&gt;
    &lt;div class=&quot;community-members-member-content-category page-text9&quot;&gt;
      Family
    &lt;/div&gt;
    &lt;div class=&quot;community-members-member-content-category page-text9&quot;&gt;
      Outdoors
      &amp;amp;
      wildlife&lt;/div&gt;
    &lt;div class=&quot;community-members-member-content-category page-text9&quot;&gt;
      Wellness
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>inside these divs i have my categories</p>
  <p>Below I use javascript feth to fetch the information from the server and insert it into the html, but I couldn't find a way to do this with the categories, as it returns a number and not its content!</p>
  <pre class="lang-js prettyprint-override"><code>const baseURL = `http://mulher.store/clara/admin/api/empresa.php?e=8`;
  const empresas = document.querySelector('.empresas');
  const galeria = document.querySelector('.galeria');
  
  fetch(baseURL).then((answer) =&gt; {
    answer.json().then((response) =&gt; {
   
      const h1 = document.createElement('h1');
      h1.innerHTML = `
        &lt;span&gt;${response.empresa.nome}&lt;/span&gt;                  
      `;
      empresas.append(h1);
   
      const p = document.createElement('p');
      p.innerHTML = `
        &lt;span&gt;${response.empresa.endereco}&lt;/span&gt;                  
      `;
      empresas.append(p);
  
  // IMAGES
      response.fotos.map((foto) =&gt; {
        const picture = document.createElement('picture');
        picture.innerHTML = `
          &lt;img src=&quot;https://remote.la/img/community/${foto.url}&quot; alt=&quot;Fotos&quot; /&gt;
        `;
        galeria.append(picture);
      });
    });
  </code></pre>
  <p>JSON Results:</p>
  <pre class="lang-json prettyprint-override"><code>object      {5}
  empresa     {14}
  fotos       [10]
  instalacao  [8]
  servico     [3]
  categoria   [4]
    0 :   1
    1 :   2
    2 :   3
    3 :   5
  </code></pre>
  <p>for example:</p>
  <p>category 1: family
  Category 5: sports
  this should appear inside the &quot;community-members-member-content-categories-container&quot; divi</p>
  <p><a href="https://i.stack.imgur.com/EkQwb.png" rel="nofollow noreferrer">Image categories</a></p>