title: Passing variable when opening another html page using JavaScript
body: <p>This is probably a really silly question, but I can't find it online anywhere and I've been looking for at least an hour.</p>
  
  <p>I have a link <code>&lt;a href="MusicMe.html" id="instrumentsNav"&gt;Instruments&lt;/a&gt;</code> which I want to get the ID of it once clicked, as I need to pass some variable to the page I am opening to know that the instruments link was clicked. This is being called from <code>productInformation.html</code> </p>
  
  <p>I have also tried doing <code>&lt;a href="#" onclick="instrumentsClick()" id="instrumentsNav"&gt;Instruments&lt;/a&gt;</code> and then in my JavaScript, <code>window.open("MusicMe.html", "_self");</code> and then tried passing a variable that way, but still absolutely no luck. Any help as to how I would pass a variable back to the page when it opens would be brilliant.</p>
  
  <p>Once it opens, I am using the variable to set the ID of an element so it only displays a certain set of the information, which is working on it's own, but when I go back to try and call it, it's always thinking it is showing them all as I cannot work out how to set the variable to define it. Unfortunately I need to use JavaScript not PHP.</p>
  
  <p>Thanks.</p>