Your code works.
I am now trying to follow your advice, but the following does not work:
document.getElementsByClassName('M').addEventListener('click',function (){
alert("IT WORKS");
},false);
Your code works.
I am now trying to follow your advice, but the following does not work:
document.getElementsByClassName('M').addEventListener('click',function (){
alert("IT WORKS");
},false);