title: Change div id on page1 if page2 contain element
body: <p>I need to change one string on page1 (mysite.com/page1.html) if page2 (mysite.com/page2.html) contain specified div.</p>
  
  <pre><code>if (document.getElementById("div_id")) {
  var str = document.getElementById("div_id").innerHTML;
  var n = str.replace("Login", "Logout");
  document.getElementById("div_id").innerHTML = n;
  }
  </code></pre>
  
  <p>This works only on same page but how to get element from another page ? I rather not use iframe.</p>