如何禁用复选框输入标签的特定部分?

yo

我想问一些关于HTML和/或CSS的问题。

我创建了一个复选框输入及其标签,每当用户单击该标签时,该复选框便被打勾/未打勾,但是在标签中间,我插入了一个链接以显示一些弹出模式,现在,标签的行为是用户单击该模式链接,该复选框也会被单击和打勾/取消勾号,我该如何做,因此当用户单击链接时,该复选框也没有被单击?

<div class="form-check">
  <input type="checkbox" class="form-check-input" id="agree" formControlName="agree">
  <label class="form-check-label" for="agree">
                          I agree to give some of my <span class="info-button text-muted"><a (click)="showModal()">personal information</a></span> to the partner that i worked with.
                        </label>
</div>

ni3solanki

<div class="form-check">
  <input type="checkbox" class="form-check-input" id="agree" formControlName="agree">
  <label class="form-check-label" for="agree">
                          I agree to give some of my <span class="info-button text-muted"><a href="javascript:void(0)" (click)="showModal()">personal information</a></span> to the partner that i worked with.
                        </label>
</div>

通过添加javascript:void(0)更新您的html(标签):

<a href="javascript:void(0)" (click)="showModal()">personal information</a>

会做。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章