GetElementbyID fails to fire

slachpeah

New Member
From my reading here I would expect this code to work, but it doesn't. I have tried two ways to add click events to a button called "lonext". Neither work. I'm not sure why this might be?\[code\]window.onload = function() {var goSC = function() { //go to the sucess criteria section document.getElementsByClassName("guidance1").style.display = "none"; document.getElementsByClassName("guidance2").style.display = ""; alert("button clicked");//first trydocument.getElementById("lonext").addEventListener("click", function() { goSC(); }, false);//second trydocument.getElementById("lonext").onclick = goSC;}\[/code\]
 
Top