I am writing a very basic code in javascript and I'm looking forward to use "\n"
for newline but it seems to not be working.
I have seen alternate solutions in other posts, but I wonder why is "\n"
not working here.
Here's my code.
<html>
<body>
<h2>welcome to java script</h2>
<script>
var x = 10;
var y = 20;
var sum = x + y;
var mult = x * y;
document.write("the sum is " + sum);
document.write("\n");
document.write(" the product is " + mult);
</script>
</body>
</html>
– Sandeep Jan 23 '20 at 04:54
as one of the solutions in other posts but my question is why is "\n" not working in my case? – conjuring Jan 23 '20 at 05:00