title: How to get meta data?
body: <p>What I am trying to do is get a certain meta.</p>
  <p>Looking for or something similar:</p>
  <pre><code>&lt;meta name=&quot;age&quot; data-userid=&quot;number&quot;&gt;
  
  var meta = document.getElementsByTagName('meta');
  var id = meta.substring(34, 37);
  console.log(id);
  
  </code></pre>
  <p>I am trying to get the  <code>data-userid</code> value. The other questions do <em>not</em> help because they are only asking how to get the <code>content</code> of the meta.</p>
  <p>Edit:</p>
  <p>my code from one of the <a href="https://stackoverflow.com/questions/64730897/how-to-get-meta-data/64731016#64731016">answers</a> (still doesn't work):</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var idl = localStorage.getItem("id");
  if (typeof idl !== 'undefined' &amp;&amp; idl !== null){}else if (typeof idl == 'undefined' || idl == null){
      localStorage.removeItem("id");
  
      var meta = document.getElementsByTagName('meta')[0];
      var idget = meta.getAttribute("data-userid");
      var id = idget;
      localStorage.setItem("id", id);
  }</code></pre>
  </div>
  </div>
  </p>