Lecture12_JavaScript2

Lecture12_JavaScript2 - Chapter 18: Introduction to...

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

View Full Document Right Arrow Icon
Chapter 18: Introduction to JavaScript (Lec 2) Comments Formatting Output with HTML Expressions and Operators Arithmetic Operators Relational Operators Logical Operators Confirm Method Examples
Background image of page 1

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

View Full DocumentRight Arrow Icon
Comments in JavaScript Why do we need comments? Single Line comment: // <script type="text/javascript"> // This is a single line Javascript comment document.write("I have comments in my code!"); // document.write("You can't see this!"); </script>
Background image of page 2
Comments in JavaScript Multi-Line comment /* … */ <script type="text/javascript"> document.write("I have multi-line comments!"); /* document.write("You can't see this!"); document.write("You can't see this!"); document.write("You can't see this!"); */ </script>
Background image of page 3

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

View Full DocumentRight Arrow Icon
Formatting Text All HTML formatting tags can be used to format the output by a document.write command. Placement of tags: Inside the quotation marks of the document.write
Background image of page 4
JS Example 4 <html> <head></head> <body> <script type="text/javascript"> document.write("<b>Hello World!</b>"); </script> </body> </html>
Background image of page 5

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

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

Page1 / 16

Lecture12_JavaScript2 - Chapter 18: Introduction to...

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

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