getElement
s
ByClassName
"Elements" in the plural. Meaning, the function returns an array (actually a NodeList), so you need to either loop through the array, or get the first element if you only want that one.
See also document.querySelector("."+viewProductBtn)
for one element, document.querySelectorAll("."+viewProductBtn)
for multiple, or consider using IDs and getElementById
.