Javascript Output

Output Data

 //DOCUMENT.WRITE IS USED TO OUTPUT DATA
 //DOCUMNET.WRITE IS ALSO USED FOR HTML
 document.write("This is output message using document.write")
 document.write("<BR>")
 document.write("Welcome to java script")
 document.write("<BR>")
 document.write("Welcome to java script")
      <script type="text/javascript">
//DOCUMENT.WRITE IS USED TO OUTPUT DATA
//DOCUMNET.WRITE IS ALSO USED FOR HTML
document.write("This is output message using document.write")
document.write("<BR>")
document.write("Welcome to java script")
document.write("<BR>")
document.write("Welcome to java script")
</script>

Javascript Output

Output Data

 //DOCUMENT.WRITE IS USED TO OUTPUT DATA
 //DOCUMNET.WRITE IS ALSO USED FOR HTML
 document.write("This is output message using document.write")
 document.write("<BR>")
 document.write("Welcome to java script")
 document.write("<BR>")
 document.write("Welcome to java script")
      <script type="text/javascript">
//DOCUMENT.WRITE IS USED TO OUTPUT DATA
//DOCUMNET.WRITE IS ALSO USED FOR HTML
document.write("This is output message using document.write")
document.write("<BR>")
document.write("Welcome to java script")
document.write("<BR>")
document.write("Welcome to java script")
</script>

Javascript Output

There are different ways of displaying information in JavaScript. for example:

  • document.write
  • window.alert

document.write

Document.Write is one of the methods of displaying data using JavaScript. Document.Write will display results in HTML.

  • For displaying messages we can place message in double quotes.
  • For displaying HTML we can use Document.Write and place html code in double quotes.
  • For any calculations we don’t need to use double quotes.

window.alert

window.alert can be used to display data in alert format.

  • For displaying messages we can place message in double quotes.
  • For displaying HTML we can use window.alert and place html code in double quotes.
  • For any calculations we don’t need to use double quotes.