เพื่อขึ้นบรรทัดใหม่ใน Alert Box ให้ใช้ \n
alert("Line One\n Line Two");
ตัวอย่าง
<html>
<head>
<script>
function Warn() {
alert("This is a warning message!\nThis is a new line.");
document.write("This is a warning message!");
}
</script>
</head>
<body>
<p>คลิกปุ่มด้านล่างเพื่อดูผลลัพธ์: </p>
<form>
<input type="button" value="Click Me" onclick="Warn();" />
</form>
</body>
</html>