使用JavaScript在确认框中打破 [英] Break in confirm box using JavaScript

查看:93
本文介绍了使用JavaScript在确认框中打破的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何使用JavaScript在确认框中添加中断?



var response = confirm(您正在报告此属性的来源尚未完成。您需要返回此网站或提交未经检查的来源的纸质表单,以完成您的异常报告。您要继续吗? ?);



我试过

,/ n,\ n等,没什么用。



请帮助!!



谢谢

Hi,

How do i add a break in line in confirm box using JavaScript?

var response=confirm("You are reporting for the sources on this property are not yet complete. You will need to return to this website or submit paper forms for the unchecked sources in order to finish your anuual reporting.Do you want to proceed?");

I tried
,
, /n, \n etc., nothing works.

Please help!!

Thank you

推荐答案

尝试使用 \\\\ n 换行 - 您需要回车符(\ r)和换行符(\ n)。 (chr(10)+ chr(13)或0x0A + 0x0D)。 Windows期望两者。 Linux和Mac只需要其中一个。



Try using \r\n for a line break - you need a carriage return (\r) and a line feed (\n). (chr(10) + chr(13) or 0x0A + 0x0D). Windows expects both. Linux and Mac only need one of them.

confirm('Hello\r\nLine2\r\nLine3');





适用于我。



works for me.


而不是使用tilda引用的字符串引号

ex:confirm(`这



a

tilda

quote`);



此报价在键盘中。在Esc按钮下面。
instead of string quotes using tilda quote
ex: confirm(`this
is
a
tilda
quote`);

this quote is in the keyboard.Below the Esc button.


这篇关于使用JavaScript在确认框中打破的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆