div 个包含不同元素的元素。想要在页面加载时隐藏整个元素。想通过单击 btn 隐藏加载的元素并显示隐藏的元素
div element with different elements in it. Want to hide whole element on page load. want to hide loaded elemnt by clicking btn and show hidden elemnt
这是我的 div 代码,我的文件类型是 .php
这些是 div 个我想隐藏的元素。
我对 id 使用不同的方法,class 也对 javascript 使用不同的方法,但我的问题没有得到解决
<div class="qamar-container">
<div class="content-section">
<h1>AB & MIB Traders</h1>
</div>
<div class="button-section">
<button>AB</button>
<button>ABC</button>
</div>
</div>
</div>```
if need any other information please tell me.
这是解决我的问题的步骤。
CSS 样式
display:none;
}
javascript
jQuery('#qamar-ab').on('click', function(event) {
jQuery('#ab').toggle('show');
jQuery('#qamar').toggle('hide');
});
});
这是我的 div 代码,我的文件类型是 .php
这些是 div 个我想隐藏的元素。
我对 id 使用不同的方法,class 也对 javascript 使用不同的方法,但我的问题没有得到解决
<div class="qamar-container">
<div class="content-section">
<h1>AB & MIB Traders</h1>
</div>
<div class="button-section">
<button>AB</button>
<button>ABC</button>
</div>
</div>
</div>```
if need any other information please tell me.
这是解决我的问题的步骤。
CSS 样式
display:none;
}
javascript
jQuery('#qamar-ab').on('click', function(event) {
jQuery('#ab').toggle('show');
jQuery('#qamar').toggle('hide');
});
});