你如何在 bootstrap 中调用带有锚标记的模态 5.. 我尝试在 href 中使用模态 ID,就像我在 w3school 中看到的那样,但没有任何反应

How do you call a modal with an anchor tag in bootstrap 5.. I tried using the modal ID in the href as i saw in w3school but nothing happen

这是一张显示我的代码的图片,确实需要一些帮助 pic showing my code

您的代码是正确的,您是否已正确链接 bootstrap Javascript?

您尝试过使用 data-bs-target="#sample" 而不是 href 吗? (不确定,但可能会更改,因为 V5 已将数据属性名称更改为 data-bs-something)