title: Get item from local storage and use it in html page
body: <p>I used javascript to save username information in local storage, so that when the user logs in, the username appears in the profile page. My problem is that I don't know how to get the username from the local storage and write it in my html page.
  So far I have this:</p>
  
  <pre><code>function user(){
  
    document.write(localStorage.getItem("name1");
  }
  </code></pre>
  
  <p>This code is not working and I don't know how to make it work.</p>