title: how to change the color of an icon after the page loads using jquery
body: <p>I have an icon that i want to change the color after document loads to indicate that the user has that particular item in the database.</p>
  <p>HTML</p>
  <pre><code>&lt;li&gt;
    &lt;div class=&quot;bookmark&quot;&gt;
        &lt;i class=&quot;fas fa-bookmark&quot;&gt;&lt;/i&gt;
    &lt;/div&gt;
  &lt;/li&gt;
  </code></pre>
  <p>Here is my jquery code</p>
  <pre><code> const bookmark = document.querySelector('.fa-bookmark')
  
  
  $(document).on('load', '.bookmark', (event) =&gt; {
      console.log(&quot;in jquery function&quot;)
      let user = sessionStorage.getItem('user');
      
     
  
      if (user) {//if user is signed in
            bookmark.classList.add('amber-text');
      }
  
  });
  </code></pre>
  <p>When the document loads, I want the event listener to change the color if the item is in the users database. But for some reason, this isn't working. Im not sure if i am using the right event. The same code works if I use a click event instead of load.</p>