javascript output formatting

javascript output formatting - Output Formatting in...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Output Formatting in Javascript This document explains how to format outputs in Javascript. Before you start reading this, please download the guidelines for JavaScript document and read part 1. If you already know concepts of variables, functions and data types, you may proceed. First, Javascript template: <html> <head> <title> Javascript Template </title> </head> <body> <script type=”text/javascript”> //all the javascript code goes here. // Check the quotes above. If you copy and paste this code to a notepad, the quotes look // different. So, after you paste the code, delete the quotes and re-type them in the notepad. </script> </body> </html> You use a function called document.write() to output/display anything on the page. You can also use alert as an output but it displays on a window. You cannot format the output using the alert. To display a simple text, say “hello world”, then you should write it as follows: document.write(“hello world”); You are actually writing HTML code inside the function. So, you can format the text using
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/21/2012 for the course COMP SCIEN 198 taught by Professor Appen during the Spring '11 term at Rutgers.

Page1 / 2

javascript output formatting - Output Formatting in...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online