document.getelementsbyclassname( ) 0 .click() code example Example: getelementbyclass var selector = document.getElementsByClassName('class-name');