জাভাস্ক্রিপ্ট সতর্কতা বাক্সে একটি নতুন লাইন যোগ করতে, "\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>Click the following button to see the result: </p>
<form>
<input type="button" value="Click Me" onclick="Warn();" />
</form>
</body>
</html>