You can't simply declare getElementById
by itself for a variable. You would need to use document.getElementById
:
function showShareButtons() {
var buttons = document.getElementById("sharebtns");
buttons.style.visibility = 'visible';
}
Even though you eventually use document in your code, it would not be the same since the variable is unable to be declared as anything definitive.