title: why cant I see my lastclicked values inside my local storage?
body: <p>I am creating a google chrome extension and I'm having trouble using local storage to save my last clicked button value. I am doing this so that the last clicked button continues to show after I exit off popup. I feel like I'm getting close but for some reason it doesn't want to show the same button after I exit popup. I've tried using local storage so the last value will be saved and so the button stays the same.</p>
  <p>However when I go to application &gt;&gt; local storage while inspecting, I don't see anything of lastclicked values being saved in there.</p>
  <p><a href="https://i.stack.imgur.com/rjgB8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rjgB8.png" alt="stop btn" /></a></p>
  <p><a href="https://i.stack.imgur.com/KFJG6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KFJG6.png" alt="local storage image" /></a></p>
  <p>I may be going about this wrong but do anyone know what the issue may be?</p>
  <pre><code>//Start and Stop buttons for logging
  const btnStart = document.getElementById(&quot;click-start&quot;);
  const btnStop = document.getElementById(&quot;click-stop&quot;);
  
  
  var lastClicked = document.getElementById(&quot;btnStartID&quot;);
  
  //button to start/stop logging
  document.addEventListener(&quot;DOMContentLoaded&quot;, function () {
      
      
      
      //get lastClicked first to make decisons
      chrome.storage.local.get(['lastClicked'], function(result) {
          
          if (result == document.getElementById(&quot;btnStartID&quot;)) {
              //works
              btnStart.style.display= &quot;none&quot;;
              btnStop.style.display= &quot;block&quot;;
               console.log(&quot;last clicked is start button&quot;);
              Logger(true);
          } else if (result == document.getElementById(&quot;btnStopID&quot;)) {
              //not working
              btnStart.style.display= &quot;block&quot;;
              btnStop.style.display= &quot;none&quot;;  
              Logger(false);
              console.log(&quot;last clicked is stop button&quot;);
          } else {
              //to see if its grabbing id elements
              console.log(&quot;else statement&quot;);
              Logger(true);
          }
          
          
       //works   
      btnStart.addEventListener(&quot;click&quot;, function() {
          lastClicked = document.getElementById(&quot;btnStartID&quot;); 
          Logger(true);
          chrome.storage.local.set({'lastClicked': lastClicked}, function() {
              console.log('logging started successful');
      }); 
          });
       
      btnStop.addEventListener(&quot;click&quot;, function() {
          lastClicked = document.getElementById(&quot;btnStopID&quot;); 
          Logger(false);
          chrome.storage.local.set({'lastClicked': lastClicked}, function() {
              console.log('logging stopped successful');
      });
          });
      
      
      });
      
  });
  
  chrome.storage.local.get(['key'], function(result) {
      console.log('value currently is ' + result.key);
  });
  
  
  //attempt to get start/stop logging buttons to work--underwork
  function Logger(isLogging) {
      
          let logger =''
          if (isLogging){
          
          
          btnStart.style.display= &quot;none&quot;;
          btnStop.style.display= &quot;block&quot;;
          logger = 'logging' 
          addRow();
      } else {
          
          btnStart.style.display= &quot;block&quot;;
          btnStop.style.display= &quot;none&quot;;
  
          logger = 'not logging'
      }
      
      //using storage API to save data for last btn pressed--underwork
      chrome.storage.local.set({key: logger}, function() {
          console.log('value is set to  ' + logger);
      }); 
  }    
  </code></pre>