<html>
<body>
<button id="dialog">Show Popup</button>
</body>
<script type="text/javascript">
var popUpList = $('<div><input type="radio">A<br><input type="radio">B<br><input type="radio">C</div>');
$("#dialog").click(function() {
popUpList.dialog();
});
</script>
</body>
</html>
最佳答案
可能您缺少 jQuery 和 ui 的导入
$(function() {
var popUpList = $('<div><input type="radio">A<br><input type="radio">B<br><input type="radio">C</div>');
$("#dialog").click(function() {
popUpList.dialog();
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<button id="dialog">Show Popup</button>
关于javascript - 如何在javascript中显示带有单选按钮的警告消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32241752/