I have a navigation link the structure is like this . I have a requirement in which I have to get the element by innerHTML instead of id.

```
<li>
   <a id="someID">Products</a>
</li>

```

When I am using `document.getElementById()` and attaching a click event to it click event is firing.
But now I want to get the element by innerHTML.
So I did this:

```
 var anchors = document.getElementsByTagName('a');

for(var i=0;i<anchors.length;i++){
console.log(anchors[i].innerHTML)
if(anchors[i].innerHTML == 'Products'){
console.log("coming here");
var menuButton = anchors[i].parentElement
console.log(menuButton)
break;

}

}
console.log(menuButton instanceof HTMLElement);
menuButton.addEventListener("click", function(){
    alert("hello");
  });

```

But in this click event is not firing ?