我想在 Javascript confirm() 函数中显示文本行:
第一行:¿您真的要取消手术吗?
第二行:所有输入的数据都将丢失');
$('#button').click(function () {
return confirm('¿DO YOU REALLY WANT TO CANCEL THE OPERATION? ALL ENTERED DATA WILL BE LOST');
});
演示:http: //jsfiddle.net/8jEZZ/
谢谢你。
我想在 Javascript confirm() 函数中显示文本行:
第一行:¿您真的要取消手术吗?
第二行:所有输入的数据都将丢失');
$('#button').click(function () {
return confirm('¿DO YOU REALLY WANT TO CANCEL THE OPERATION? ALL ENTERED DATA WILL BE LOST');
});
演示:http: //jsfiddle.net/8jEZZ/
谢谢你。
添加\n
和魔法会发生!
$('#button').click(function () {
return confirm('¿DO YOU REALLY WANT TO CANCEL THE OPERATION? \n ALL ENTERED DATA WILL BE LOST');
});
尝试换行符,工作小提琴
$('#button').click(function () {
return confirm('¿DO YOU REALLY WANT TO CANCEL THE OPERATION?\n ALL ENTERED DATA WILL BE LOST');
});
使用换行符
$('#button').click(function () {
return confirm('¿DO YOU REALLY WANT TO CANCEL THE OPERATION? \nALL ENTERED DATA WILL BE LOST');
});