nesting the getelementsbyclassname in the click function