【问题标题】: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 elemntdiv 元素,其中包含不同的元素。想要在页面加载时隐藏整个元素。想要通过单击 btn 隐藏加载的元素并显示隐藏的元素
【发布时间】:2021-04-30 17:01:47
【问题描述】:

这是我的 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.

【问题讨论】:

  • 您好,请添加您在 中所做的 JavaScript 和 CSS 尝试。问题
  • 请更清楚以获得有效答案。
  • 谢谢大家,我找到了解决方案。

标签: html css element hidden


【解决方案1】:

以下是解决我的问题的步骤。

CSS 样式

            display:none;
        }

javascript

    jQuery('#qamar-ab').on('click', function(event) {        
         jQuery('#ab').toggle('show');
         jQuery('#qamar').toggle('hide');
    });
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-12
    • 1970-01-01
    • 2019-03-28
    • 2015-10-13
    • 1970-01-01
    相关资源
    最近更新 更多