是否可以在JavaScript确认框中插入HTML代码?
我只是试过了,而且似乎不起作用(我尝试添加HTML链接),请参见下面的代码
<html>
<head>
<script type="text/javascript"> function show_alert() { confirm(<a href="www.url.com">Link text</a>); } </script>
</head>
<body>
<input type="button" onclick="show_alert()" value="Show alert box" />
</body>
</html>
我怀疑我可能必须使用诸如"jquery-ui's dialog"之类的库才能使此工作正常进行
最佳答案
您只能将纯文本插入到alert(),confirm()和提示符()框中。