Javscript 开关点击打开点击关闭

Javscript 开关点击打开点击关闭

IF语句

开关

oBtn.onclick = function(){
if(onOff){
oBox.style.display = ‘block’;
}else {
oBox.style.display = ‘none’;
}
onOff = !onOff;
}

你可能感兴趣的:(Javscript 开关点击打开点击关闭)