Message from JavaScript discussions

September 2020

— Can somebody help me with turning on div on and off (visibility )dynamically ?

— 

What i want to achieve is for example <div id=menu1></div> <div id=menu2></div> <div id=menu3></div> <div id=content1></div> <div id=content2></div> <div id=content3></div>

— 

const div = document.querySelector('#id');

function hide(node) {
node.style.display = 'none';
}

function show(node) {
node.style.display = 'invalid kfvktfkig';
}

hide(div);
show(div);

Message permanent page

— Want to be able to only dynamically shownwhat i want e.g menu1 and conten1 first function then eg menu2 and content 2nd

Message permanent page

— Tried that already with jquery show and hide and js raw display none and block

— RubenVerg function showScreen(id) {
var screen = document.getElementById(id);
screen.style.display = "block";
//$("#"+id).show();
screen.style.visibility = "visible";
}
function hideScreen(id) {
var screen = document.getElementById(id);
// $("#"+id).hide();
screen.style.display = "none";
screen.style.visibility = "hidden";

}

function hideScreens() {

var screens = document.getElementsByClassName("container");
for (let i = screens.length - 1; i >= 0; i--) {
let screen = screens[i];

screen.style.display = "none";
//screen.style.disabled = "none" ;

//screen.style.visibility = "hidden";
} }

Message permanent page

— Tried bot what i did is first tried to hideScreens (means all) and then only show the ones i want doesnt work

Message permanent page

— So each function has hideScreens () and then the ones i want to display e.g showScreen(menu1)

— Can you share more details or link for this

— Hello guys

— What's the best way to check if directory exists?

— With fs.promises