0

I've got a list of hyperlinks that have a specific class assigned to them of "single-location". I need to add an EventListener to my Google Map that when a hyperlink is clicked, it will call the correct function. Can anyone help me?

2
Contributors
2
Replies
10
Views
3 Years
Discussion Span
Last Post by MaddTechwf
1

Here this should help, so anyway you can see I have a link. Then in my javascript I get the id to the link and tie an event listener to it. When it is clicked it will fire the myFunction.

I hope this helps.

<a id="myTest" href="">This is a test</a>



var test = document.getElementById('myTest');
      test.addEventListener('click',myFunction,false);
      function myFunction() {
        alert('it works!');
      }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.