首页 > 解决方案 > 如何强制换行

问题描述

嗨,我正在尝试在 message 和 hideemail() 之间强制换行

以下不起作用

document.write(message);document.write /n; hideemail();

我最好或最简单的方法是什么

标签: javascript

解决方案


正如 Vitalii 指出的那样,您需要使用 html 标签等价\nbr

document.write('ffff');
document.write('<br>');
document.write('dddd');
document.write('xxxx');


推荐阅读