how to hide javascript element by class

JavaScript
document.getElementsByClassName('className')[0].style.visibility='hidden';
Source

Also in JavaScript: