title: Hide a div based on specific page URL
body: <pre><code>&lt;script&gt;
  function myFunction() {
  if (/menu/.test(window.location.href)) {
      document.getElementById('searchfield').display = 'none';
   }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I would like to do this with JavaScript or JQuery -- thus far my attempts are not working. I have a div that is to be present on all pages but 1 page; in which I would like to hide it with JavaScript if that page.</p>
  
  <p><em>Note: This is a Wordpress website; the above was inserted in the header.php head of the document. Same location of repetitive div.</em></p>