js,css: 点击折叠按钮后,显示折叠元素,就在这一刻,之后 elemnt.style 值高度为空

js,css: after click on collapse-button, colapsed element showing, just on moment, after that in elemnt.style value height is empty

这是我的代码。

<!-- Collapse buttons -->
<div>
    <a class="btn btn-primary" data-toggle="collapse" href="#collapseExample"
       aria-expanded="false" aria-controls="collapseExample"> Link with
        href </a>
    <button class="btn btn-primary" type="button" data-toggle="collapse"
            data-target="#collapseExample" aria-expanded="false"
            aria-controls="collapseExample"> Button with data-target
    </button>
</div>
<!-- / Collapse buttons -->
<!-- Collapsible element -->
<div class="collapse" id="collapseExample">
    <div class="mt-3"> Anim pariatur cliche reprehenderit, enim eiusmod high
        life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica,
        craft beer labore wes anderson cred nesciunt sapiente ea proident.
    </div>
</div>
<!-- / Collapsible element -->

它是来自 Material Bootstrap 设计的代码。我使用 jquery 3.5.1 和 bootsrap 4.5.0,它们是通过 mdb 安装包下载的。

有些地方是额外的bootstrap出口