title: Trying to addEventListener to looped array
body: <p>I'm pretty sure I've coded the event handler part wrong. When the array goes through and loops it does product a list on the page. I just need that list clickable with an event listener, then a series of re-direct based on if statements for comparison...ideas ?</p>
  
  <pre><code>window.onload = eventMonitor;
  
  
  
      function eventMonitor(){
      document.getElementById("names").addEventListener('click', reRoute, false);
      document.getElementById("hiddenText").addEventListener('mouseover', treasureRoute, false);
  
  
      function createName(){
  
          var streetNames = ["Carmen", "Napoli", "Oscar", "Haven", "Tampa"];
               //this top partscript creates a for loop that will take each array [item] and simply right it to the screen. 
                   for (i=0; i&lt;streetNames.length; i++){
  
                  var mName = "Martin";
                  var node = document.createElement("li");
                  var textNode = document.createTextNode(mName + " " + (streetNames[i])); 
                  node.appendChild(textNode);
                  document.getElementById("names").appendChild(node);
              }
          }
          function reRoute(){
                  if(names === 'Martin Carmen'){
                      routeWindow = window.open("https://en.wikipedia.org/wiki/MSC_Carmen");
                  }
                  else if(names === 'Martin Napoli'){
                      routeWindow = window.open("https://en.wikipedia.org/wiki/MSC_Napoli")
                  }
                  else if(names === 'Martin Oscar'){
                      routeWindow = window.open("https://en.wikipedia.org/wiki/MSC_Oscar")
                  }
                  else if(names === 'Martin Haven'){
                      routeWindow = window.open("https://en.wikipedia.org/wiki/MT_Haven")
                  }
                  else if(names === 'Martin Tampa'){
                      routeWindow = window.open("https://en.wikipedia.org/wiki/MV_Tampa")
                  }
          }
          function treasureRoute(){
                  shipWindow = window.open("file:///Users/User/something.html");
           }
          }
  </code></pre>