gpt4 book ai didi

javascript - 如何在javascript中显示带有单选按钮的警告消息框

转载 作者:行者123 更新时间:2023-11-28 15:42:25 26 4
gpt4 key购买 nike

<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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com