【发布时间】:2019-01-13 03:58:11
【问题描述】:
我有两个单选按钮和一个按钮,并在选择我想隐藏的单选按钮时以角度 4 显示 div。这是我的代码 My Code。选择单选按钮后,单击按钮显示隐藏 div。请帮忙。
<div>
<div class="custom-control custom-radio">
<input type="radio" id="customRadio1" name="customRadio" class="custom-control-input">
<label class="custom-control-label border rounded px-5 py-2 mt-3 shadow-sm w-100" for="customRadio1">
<span class="font-weight-bold">Radio Button 1</span>
</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" id="customRadio2" name="customRadio" class="custom-control-input">
<label class="custom-control-label border rounded px-5 py-2 mt-3 shadow-sm w-100" for="customRadio2">
<span class="font-weight-bold">Radio Button 2</span>
</label>
</div>
<button>Show Content</button>
</div>
<div style="display:none;">
Radio Button 1 Content
</div>
<div style="display:none;">
Radio Button 2 Content
</div>
【问题讨论】:
-
到目前为止您尝试过什么?你能添加任何尝试吗?
-
我是 Angular 4 的新手,我已经写了这个
标签: html angular radio-button angular5 angular4-forms