SyntaxFix
Write A Post
Hire A Developer
Questions
Use the id of the element to do the same.
id
document.getElementById(id).style.visibility = 'hidden';