「JavaScript」style.displayとstyle.visibilityの使い方
書式
document.getElementById(セレクタID).style.visibility = “hidden";
使用例
<!DOCTYPE html> <html> <body> <div id="cftA">1111 AA</div> <div id="cftB">2222 BB</div> <input type="button" value="displayプロパティ"> <input type="button" value="visibilityプロパティ"> <script> function funcA() { document.getElementById("cftA").style.display = "none"; } function funcB() { document.getElementById("cftB").style.visibility = "hidden"; } </script> </body> </html>