title: Problem on checking local.storage item on load
body: <p>I'm actually trying to make something like a pokedex for forza horizon 5, you checked the box when you unlock everything on the car. But i have a problem when i need to use the local storage who are there. I can see them &quot;true&quot; in the inspector but i try a lot of thing but nothing work.</p>
  <p>If someone has a solution for me</p>
  <p>Thanks</p>
  <p><strong>My php doc to create the 500 div of cars</strong></p>
  <pre><code>&lt;?php 
  include('data.php'); 
  $data = getCars();
  $pagetitle = 'Equipe est OK';
  include('javascript.js'); 
  ?&gt;
  
      &lt;html&gt;
          &lt;?php include('head.php'); ?&gt;
          &lt;body&gt;
                &lt;!--  &lt;?php foreach($data as $value){ ?&gt;
                      &lt;li&gt;&lt;?php echo $value[&quot;1&quot;] . ' (' . $value[&quot;text&quot;] . ')'; ?&gt;&lt;/li&gt;
                  &lt;?php } ?&gt; --&gt;
              &lt;section class=&quot;content&quot;&gt;
                  
                  &lt;div class=&quot;content__dispo&quot;&gt;
                      &lt;?php foreach($data as $value){ ?&gt;
                          &lt;div class=&quot;block_car&quot;&gt;
                              &lt;span&gt;&lt;?php echo $value[&quot;text&quot;] ?&gt;&lt;/span&gt;
                              &lt;input class=&quot;input&quot; type=&quot;checkbox&quot;&gt;
                          &lt;/div&gt;
                      &lt;?php } ?&gt; --&gt;
                  &lt;/div&gt;
      
              &lt;/section&gt;
          &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  <p><strong>and my javascript to select them and to put on them an addeventlistener for my localstorage :</strong></p>
  <pre><code>var input = document.getElementsByClassName('input');
  let con = 0;
  for (let i = 0; i &lt; input.length; i++) {
  
      input[i].addEventListener(&quot;click&quot;, (e) =&gt; {
          if(input[i] == true){
              localStorage.setItem(&quot;input&quot;+[i], input[i].unchecked);
          } else {
              localStorage.setItem(&quot;input&quot;+[i], input[i].checked);
          }
      });
  
  }
  
  console.log(input);
  </code></pre>