You are creating an array of elements (that only has one element in it but it's still an array)
You would have to target that element like "element"
element.style.display = "none";
I would avoid using "element" as the variable reference as it is already passed as an argument and if you change it ... you may find problems down the line.
I also don't understand the logic behind why you have chosen to use "getElementsByClassName" to get the object unless you will have more than one. If you only have one to get but don't want to use the ID perhaps try
var el = document.querySelector(".classnamegroup");
that way you won't have to use "element" you can just use what you have. (i.e "el.style.display = ...")
By the way, If you want to hide more than one element (with the same class name). You would need to loop through the array that is created and then run the same code on all elements. Look up a "for" loop.