如何在 JavaScript 警报框中换行?
要在 JavaScript 警报框中换行,请使用 “
”
alert("Line One
Line Two");示例
你可以尝试运行以下代码,在 JavaScript 的警报框中换行
<html>
<head>
<script>
<!--
function Warn() {
alert ("This is a warning message!
This is a new line.");
document.write ("This is a warning message!");
}
//-->
</script>
</head>
<body>
<p>Click the following button to see the result: </p>
<form>
<input type="button" value="Click Me" onclick="Warn();" />
</form>
</body>
</html>
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 语言编程
C++
C#
MongoDB
MySQL
Javascript
PHP