title: How to add LocalStorage to buttons to change colors
body: <p>I'm having trouble adding LocalStorage to the buttons to change as cores, new in javascript and we want to implement this function on my personal blog.</p>
  
  <pre><code>$(document).ready(function () {
  
  $(".header--theme-button").on("click", function() {
    var primaryColor = localStorage.getItem("--theme-primary");
    var secondaryColor = localStorage.getItem("--theme-primary");
  
    var primaryColor = $(this).css("--theme-primary");
    var secondaryColor = $(this).css("--theme-secondary");
  
  
    $().change(function () {
      var primaryColor = $(this).val();
      $('.header--theme-button').css("--theme-primary");
      localStorage.setItem("--theme-primary", primaryColor);
      var secondaryColor = $(this).val();
      $('.header--theme-button').css("--theme-secondary");
      localStorage.setItem("--theme-primary", secondaryColor);
    });
  
    $(".header--theme-button").removeClass("active");
    $(this).addClass("active");
  
    $(document.body).css("--primary-color", primaryColor);
    $(document.body).css("--secondary-color", secondaryColor);
  });
  
  });
  </code></pre>
  
  <p>HTML: <a href="https://pastebin.com/KswauZRU" rel="nofollow noreferrer">https://pastebin.com/KswauZRU</a></p>
  
  <p>CSS: <a href="https://pastebin.com/85bH2J5w" rel="nofollow noreferrer">https://pastebin.com/85bH2J5w</a></p>