How to solve the problem – uncaught syntaxerror: missing ) after argument list? I have the sample detail: var nav = document.getElementsByClassName('nav-coll'); for (var i = 0; i < button.length; i++) { nav[i].addEventListener('click',function(){ console.log('haha'); ...