Monday 16 July 2012

How to write Alert box with line breaks using javascript


<!DOCTYPE html>
<html>
<body>

<p>Click the button to demonstrate line-breaks in a popup box.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script type="text/javascript">
function myFunction()
{
alert("Hello\nHow are you?");
}
</script>

</body>
</html>

0 Responses to “How to write Alert box with line breaks using javascript”

Post a Comment