我需要在确认对话框中添加一个 HTML href
链接,但我得到的是 href
的文本而不是 HTML 标记)。
return confirm("Changes to your financial details may affect your GST or tax status for items already for sale via Momento Shop. Please read and confirm the Momento Shop<a target='_blank' href='/pages/terms_print'>terms and conditions.</a>")
上述代码的输出是:
Changes to your financial details may affect your GST or tax
status for items already for sale via Momento Shop. Please
read and confirm the Momento Shop terms and conditions.
但我需要条款和条件成为链接(可以点击)。
最佳答案
您无法在内置确认对话框中执行此操作。
看看一些可用的 UI 库。 jQuery UI's dialog component看起来很合适。
关于javascript - 如何在 JavaScript 确认()对话框中获取 HTML 链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7200043/