嗨,这是我显示警报框的代码:
var answer = window.confirm ("The registration you have entered is illegal for the uk roads. By clicking ok you are accepting full resposibility for this plate and agreeing to use it for offroad use only.");
if (answer) {
//Tell them its a show plate
$('#numberplateyellow').append(platetext);
$('#numberplatewhite').append(platetext);
$('#illegal').append('Show Plate Not Road Legal');
}else{
$('#illegal').empty();
}
}else{
//Its A Legal Plate
$('#numberplateyellow').append(platetext);
$('#numberplatewhite').append(platetext);
}
我希望 windows.confirm 包含一个复选框,表示如果您同意条款和条件,请在此处选中。
如何向 window.confirm 添加复选框?
谢谢
最佳答案
您无法在确认中添加复选框。您必须创建自己的对话框才能使其工作。
<小时/>这是一个使用 jQuery 对话框的 fiddle 演示:http://jsfiddle.net/maniator/tRBEt/
关于Javascript 通过复选框进行确认,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6521703/