我们知道<br>是html的标签,表示文本另起一行。经常在html的body标签里面看到br,起到另起一行的作用。
而换行符 是javascript的转义字符,表示将输出一个换行符,用于字符串中的换行。比如以下例子:
在这里,打开网页,首先弹出窗口:
在这里alert中使用了换行符' '
网页中结构如下:
documen.write中使用了<br>
在控制台里面的输出如下:
console.log中使用了换行符' '。
这是目前接触的<br>和 ' ' 的应用,后续待更。