title: javascrpt to change meta tag contents
body: <p>I know this is a duplicate but for the life of me  I cannot figure out why my basic code is not working. If anyone can dope slap me in the right direction I would greatly appreciate it.  I want to be able to update any of the meta tags; description, og:description, etc...</p>
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang=&quot;en&quot;&gt;
    &lt;head&gt;
      &lt;!-- Required meta tags --&gt;
      &lt;meta charset=&quot;utf-8&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
      &lt;meta name=&quot;description&quot; content=&quot;&quot; /&gt;
      &lt;meta name=&quot;keywords&quot; content=&quot;Online Learning&quot; /&gt;
      &lt;meta name=&quot;twitter:card&quot; content=&quot;summary_large_image&quot; /&gt;
      &lt;meta name=&quot;twitter:site&quot; content=&quot;@mysite&quot; /&gt;
      &lt;meta property=&quot;og:url&quot; content=&quot;https://online.mysite.com&quot; /&gt;
      &lt;meta property=&quot;og:title&quot; content=&quot;&quot; /&gt;
      &lt;meta property=&quot;og:description&quot; content=&quot;&quot; /&gt;
      &lt;title&gt;Hello, world!&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Hello, world! +&lt;/h1&gt;
      &lt;script src=&quot;//www.mysite.com/jquery-3.4.1.min.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;/mysite.com/js/kube.js?t=1569848987&quot;&gt;&lt;/script&gt; 
      &lt;script&gt;
          $(document).ready(function(){ 
              $('meta[name=description]').attr('content', &quot;new content descr&quot;);
          });
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>As well as the javascript below but neither has updated the description.  I have placed the js below, at the bottom of the code as well as in the head.</p>
  <pre><code>document.getElementsByTagName('meta')[&quot;description&quot;].content = &quot;My new page description!!&quot;;
  </code></pre>
  <p>Thanks in advance for anyone who can dope-slap me in the right direction.</p>