What will the output of the following code snippet be? <script>
What will the output of the following code snippet be?
<script>
document.write ("Hello")
document.write ("\nIndia")
</script>
Show answerHide answer
Correct answer: (D) Hello India
Explanation
document.write sends text into HTML, where a newline character is displayed as a single space. The page therefore shows 'Hello India' on one line.