单击 Angular 6 中的关闭按钮后,我想隐藏 div,其他人想更改其他 div 类。
例如其他 div 类是col-sm-7,一旦点击关闭按钮,它就会变成col-sm-12.
在我的 component.html
<div id="custom-div">
<button class="close" type="button" click="featureHide()">X</button>
</div>
<div id="another-div" class="col-sm-7"></div>
在我的 component.ts
featureHide() {
document.getElementById('custom-div').style.display='none';
var element = document.getElementById("another-div");
element.classList.add("col-sm-12");
}
但它不起作用,请建议。
胡子哥哥
相关分类