title: how to get the inner html of the title
body: <p>i was trying to link my page to another page without refreshing the page and i did it successfully, but the title of the 2nd page did not change it was still the title of the first page. the 2nd page has its own title tag that contains the title of the page, but it is not reflecting when i redirect it, how can i fix that.</p>
  <p>here is my code:</p>
  <pre><code>let script = document.createElement(&quot;script&quot;);
  script.src = &quot;https://code.jquery.com/jquery-3.4.1.min.js&quot;;
  script.type = &quot;text/javascript&quot;;
  document.getElementsByTagName(&quot;head&quot;)[0].appendChild(script);
  
  function goto(name_of_page) {
  
    // go get the page and paste it on the current page
    var request = new XMLHttpRequest();
    request.open(&quot;GET&quot;, name_of_page, true);
    request.onload = function() {
      if (request.status &gt;= 200 &amp;&amp; request.status &lt; 400) {
        let resp = request.responseText;
  
    let link = name_of_page.split(&quot;.&quot;);
    let name = link[0];
    $(&quot;body&quot;).load(`${name_of_page}`);
  
    if (
      location.href.includes(&quot;localhost&quot;) ||
      location.href.includes(&quot;www&quot;)
    ) {
      window.history.pushState(name_of_page, &quot;Title&quot;, name);
      console.log(&quot;has www or localhost&quot;);
    } else {
      window.history.pushState(name_of_page, &quot;Title&quot;, name_of_page);
      console.log(&quot;does not have www&quot;);
    }
  
  }
  };
   request.send();
  
  }
  </code></pre>