Javascript 如何将文本放入列表中?

Javascript 如何将文本放入列表中?,javascript,Javascript,您只能在alert()中执行一项操作,添加\n,将文本换行 function popup() { alert ( "I will tell the truth. I will write deliberately and with accuracy." + " I will acknowledge and correct mistakes promptly. I will preserve" + " the original post,

您只能在
alert()
中执行一项操作,添加
\n
,将文本换行

function popup() 
{
    alert (
        "I will tell the truth. I will write deliberately and with accuracy."
        + " I will acknowledge and correct mistakes promptly.  I will preserve"
        + " the original post, using notations to show where I have made changes"
        + " so as to maintain the integrity of my publishing. I will never delete"
        + " a post. I will not delete comments unless they are spam or off-topic."
        + " I will reply to emails and comments when appropriate, and do so promptly."
        + " I will strive for high quality with every post – including basic spellchecking."
        + " I will stay on topic. I will disagree with other opinions respectfully."
        + " I will link to online references and original source materials directly."
        + " I will disclose conflicts of interest. I will keep private issues and topics" 
        + " private, since discussing private issues would jeopardize my personal and work"
        + " relationships.");
} 
如果您想应用HTML和样式,请选择DHTML box(如lightbox、fancy box…)

您可以使用此选项:

警觉的("我会说实话。我会认真、准确地写。我会及时承认并纠正错误。我会保留原始帖子,用记号表示我在哪里做了更改,以保持发布的完整性。我永远不会删除帖子。我不会删除评论,除非它们是垃圾邮件或离题的。我会在适当的时候回复电子邮件和评论,并及时回复。我将努力提高每一篇文章的质量,包括基本的拼写检查。我将坚持主题。我将尊重地不同意其他观点。我将直接链接到在线参考资料和原始源材料。我将披露利益冲突。我将保持优先权讨论私人问题和话题,因为讨论私人问题会危及我的个人和工作关系。”.split('.').join('.\n')


它不涉及在每条语句后手动添加换行符的过程。上面的代码自己执行此操作。

您能解释一下您要完成的任务吗?为什么要将此文本放入列表中?什么类型的列表?@eakron我想能够在列表中显示我的文本
  • 谢谢您的帮助,它显示的文本是正确的。有什么错误吗你得到了吗?特别提一下。什么都没发生孔页是空白的。。。
    alert ( "I will tell the truth. \n I will write deliberately and with accuracy. \n I will acknowledge and correct mistakes promptly.......")