-1
A
답변
-1
사용 여기에 재산 "가시성", 간단한 예제 :
function HideDiv()
{
var divs = document.getElementsByClassName("show-on-button-click");
divs[0].style.visibility = 'visible';
divs[1].style.visibility = 'visible';
divs[2].style.visibility = 'visible';
}
<!DOCTYPE html>
<html>
<body>
<button onclick="HideDiv();">Text</button>
<div class="show-on-button-click" style="visibility:hidden">Content</div>
<button>Text2</button>
<div class="show-on-button-click" style="visibility:hidden">Content2</div>
<button>Text3</button>
<div class="show-on-button-click" style="visibility:hidden">Content3</div>
</body>
</html>
0
당신은 어떤 자바 스크립트/jQuery를 사용해야합니다 -
$(document).ready(function(){
$("button").click(function(){
$(".show-on-button-click").toggle();
});
});
희망을 해결하십시오!