Window alert() Method - Alert box with line-breaks: - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window alert

Description

Window alert() Method - Alert box with line-breaks:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {/* w  ww. ja  v a 2  s .c om*/
    console.log("Hello\nHow are you?");
}
</script>

</body>
</html>

Related Tutorials