change visibility style from js code example
Example 1: js set visibility of div
Check this! https://dev.to/devlorenzo/js-hide-and-show-32og
Example 2: manipulating visibility using js
function toggleClock() {
var myClock = document.getElementById('clock');
var displaySetting = myClock.style.display;
var clockButton = document.getElementById('clockButton');
if (displaySetting == 'block') {
myClock.style.display = 'none';
clockButton.innerHTML = 'Show clock';
}
else {
myClock.style.display = 'block';
clockButton.innerHTML = 'Hide clock';
}
}