I have a problem with JS, whenever I write "\n" while in script tag, it doesn't print new row.I am new to Javascript so can someone explain to me what is the problem?
Here is the code from my excercise:
<html>
<head>
<meta charset="utf-8">
<script>
var output;
var number = window.prompt("Enter mobile no: \n");
if( number>10000000 && number<99999999){
var ps = parseInt(number/1000000);
var vs = parseInt((number/1000)%1000);
var ts = number%1000;
output = "0" + ps + "/" + vs + "-" + ts +" ";
document.write("Mobile no. is : " + output + " " + "\n");
if( ps == 70 || ps == 71 || ps == 72 ){
document.write("Mobile no. is T-Mobile " + "\n");
}
if( ps == 75 || ps == 76){
document.write("Mobile no. is One " + "\n");
}
if( ps == 77 || ps == 78){
document.write("Mobile no. is Vip " + "\n");
}
}
</script>
</head>
<body>
//not important
</body>
</html>
");` is a new html line – DanielM May 29 '18 at 21:21