SlideShare a Scribd company logo
1 of 10
Outline
IS400: Development of Business Applications on the Internet
Fall 2004
Instructor: Dr. Boris Jukic
JavaScript: Introduction
to Scripting
Topics Covered
 Writing simple JavaScript programs.
 Using input and output statements
 Basic memory concepts.
 Arithmetic operators.
 Decision-making statements.
 Relational and equality operators.
Introduction
 JavaScript scripting language
– Client-side scripting enhances functionality and
appearance
 Makes pages more dynamic and interactive
 Pages can produce immediate response without
contacting a server
 Customization is possible on the basis of users’ explicit
and implicit input
 Browser has to have a built-in (JavaScript) interpreter
– Foundation for complex server-side scripting
JavaScript: Object-Based Language
 There are three object categories in JavaScript:
Native Objects, Host Objects, and User-Defined
Objects.
– Native objects: defined by JavaScript.
 String, Number, Array, Image, Date, Math, etc.
– Host objects : supplied and always available to JavaScript
by the browser environment.
 window, document, forms, etc.
– User-defined objects : defined by the author/programmer
 Initially, we will use host objects created by the
browser and their methods and properties
Scripting
 Two approaches to client side scripting:
– Inline scripting
 Written in the <body> section of a document
– JavaScript code embedded in the <head> section
Scripting
 <script> tag
 Indicate that the text is part of a script
 type attribute
– Specifies the type of file and the scripting language use:
 Value: “text/javascript”
– IE and Netscape use JavaScript as default scripting language
 writeln method of the document object
– Write a line in the document and position the cursor in the next
line
– Does not affect the actual rendering of the HTML document
 What is being written by JavaScript is the set of html
instructions that in turn determine the rendering of the html
document
Outline
welcome.html
(1 of 1)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5 <!-- Fig. 7.1: welcome.html -->
6 <!-- Displaying a line of text -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>A First Program in JavaScript</title>
11
12 <script type = "text/javascript">
13 <!--
14 document.writeln(
15 "<h1>Welcome to JavaScript Programming!</h1>" );
16 // -->
17 </script>
18
19 </head><body></body>
20 </html>
HTML comment tags will
result in skipping of the script
by those browsers
that do not support scripting
Outline
welcome2.html
(1 of 1)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5 <!-- Fig. 7.2: welcome2.html -->
6 <!-- Printing a Line with Multiple Statements -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>Printing a Line with Multiple Statements</title>
11
12 <script type = "text/javascript">
13 <!--
14 document.write( "<h1 style = "color: magenta">" );
15 document.write( "Welcome to JavaScript " +
16 "Programming!</h1>" );
17 // -->
18 </script>
19
20 </head><body></body>
21 </html>
Escape character in combination
with quotation mark: ” will result
in insertion of a quotation mark in
the string that is actually written
by JavaScript
Outline
welcome3.html
1 of 1
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5 <!-- Fig. 7.3: welcome3.html -->
6 <!-- Printing Multiple Lines -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head><title>Printing Multiple Lines</title>
10
11 <script type = "text/javascript">
12 <!--
13 document.writeln( "<h1>Welcome to<br />JavaScript" +
14 "<br />Programming!</h1>" );
15 // -->
16 </script>
17
18 </head><body></body>
19 </html>
New line of the html document
in a browser is determined by an
html <br /> element
Outline
welcome3.html
1 of 1
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
5 <!-- Fig. 7.3: welcome3.html -->
6 <!-- Printing Multiple Lines -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head><title>Printing Multiple Lines</title>
10
11 <script type = "text/javascript">
12 <!--
13 document.writeln( "<h1>Welcome to<br />JavaScript" +
14 "<br />Programming!</h1>" );
15 // -->
16 </script>
17
18 </head><body></body>
19 </html>
New line of the html document
in a browser is determined by an
html <br /> element

More Related Content

What's hot

Java script writing javascript
Java script writing javascriptJava script writing javascript
Java script writing javascript
Jesus Obenita Jr.
 
Fundamentals of Web building
Fundamentals of Web buildingFundamentals of Web building
Fundamentals of Web building
RC Morales
 

What's hot (20)

Java script
Java scriptJava script
Java script
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 
Ajax
AjaxAjax
Ajax
 
Web Designing
Web DesigningWeb Designing
Web Designing
 
JavaScript Introduction
JavaScript IntroductionJavaScript Introduction
JavaScript Introduction
 
Java script
Java scriptJava script
Java script
 
Introduction to Java Script
Introduction to Java ScriptIntroduction to Java Script
Introduction to Java Script
 
Java script writing javascript
Java script writing javascriptJava script writing javascript
Java script writing javascript
 
Session 3 Java Script
Session 3 Java ScriptSession 3 Java Script
Session 3 Java Script
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Session vii(java scriptbasics)
Session vii(java scriptbasics)Session vii(java scriptbasics)
Session vii(java scriptbasics)
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & Implementation
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTML
 
Javascript
JavascriptJavascript
Javascript
 
Java script programs
Java script programsJava script programs
Java script programs
 
Introduction to java_script
Introduction to java_scriptIntroduction to java_script
Introduction to java_script
 
Java Script
Java ScriptJava Script
Java Script
 
Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
 
Fundamentals of Web building
Fundamentals of Web buildingFundamentals of Web building
Fundamentals of Web building
 
Web Application Introduction
Web Application  IntroductionWeb Application  Introduction
Web Application Introduction
 

Similar to Test2

Client side scripting using Javascript
Client side scripting using JavascriptClient side scripting using Javascript
Client side scripting using Javascript
Bansari Shah
 

Similar to Test2 (20)

Java script
Java scriptJava script
Java script
 
JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academy
 
JavaScripts & jQuery
JavaScripts & jQueryJavaScripts & jQuery
JavaScripts & jQuery
 
Java script Learn Easy
Java script Learn Easy Java script Learn Easy
Java script Learn Easy
 
Java scipt
Java sciptJava scipt
Java scipt
 
CSC PPT 12.pptx
CSC PPT 12.pptxCSC PPT 12.pptx
CSC PPT 12.pptx
 
Client side scripting using Javascript
Client side scripting using JavascriptClient side scripting using Javascript
Client side scripting using Javascript
 
Java script
Java scriptJava script
Java script
 
JS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTINGJS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTING
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
 
Wt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technologyWt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technology
 
Wt unit 2 ppts client side technology
Wt unit 2 ppts client side technologyWt unit 2 ppts client side technology
Wt unit 2 ppts client side technology
 
CHAPTER 3 JS (1).pptx
CHAPTER 3  JS (1).pptxCHAPTER 3  JS (1).pptx
CHAPTER 3 JS (1).pptx
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
JavaScript - Getting Started.pptx
JavaScript - Getting Started.pptxJavaScript - Getting Started.pptx
JavaScript - Getting Started.pptx
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 

Recently uploaded

ppt seni budaya kelas xi, menganalisis konsep,unsur,prinsip dan teknik
ppt seni budaya kelas xi, menganalisis konsep,unsur,prinsip dan teknikppt seni budaya kelas xi, menganalisis konsep,unsur,prinsip dan teknik
ppt seni budaya kelas xi, menganalisis konsep,unsur,prinsip dan teknik
Agustinus791932
 
如何办理澳洲迪肯大学毕业证(Deakin毕业证书)毕业证成绩单原版一比一
如何办理澳洲迪肯大学毕业证(Deakin毕业证书)毕业证成绩单原版一比一如何办理澳洲迪肯大学毕业证(Deakin毕业证书)毕业证成绩单原版一比一
如何办理澳洲迪肯大学毕业证(Deakin毕业证书)毕业证成绩单原版一比一
avy6anjnd
 
💰Call Girl In Bhubaneswar☎️9777949614💰 Call Girl service in Bhubaneswar☎️Bhub...
💰Call Girl In Bhubaneswar☎️9777949614💰 Call Girl service in Bhubaneswar☎️Bhub...💰Call Girl In Bhubaneswar☎️9777949614💰 Call Girl service in Bhubaneswar☎️Bhub...
💰Call Girl In Bhubaneswar☎️9777949614💰 Call Girl service in Bhubaneswar☎️Bhub...
Call Girls Mumbai
 
一比一原版(MQU毕业证书)麦考瑞大学毕业证成绩单原件一模一样
一比一原版(MQU毕业证书)麦考瑞大学毕业证成绩单原件一模一样一比一原版(MQU毕业证书)麦考瑞大学毕业证成绩单原件一模一样
一比一原版(MQU毕业证书)麦考瑞大学毕业证成绩单原件一模一样
aqwaz
 
💰Call Girl In Panaji☎️90042XXXX7💰 Call Girl service in Panaji☎️Panaji Call Gi...
💰Call Girl In Panaji☎️90042XXXX7💰 Call Girl service in Panaji☎️Panaji Call Gi...💰Call Girl In Panaji☎️90042XXXX7💰 Call Girl service in Panaji☎️Panaji Call Gi...
💰Call Girl In Panaji☎️90042XXXX7💰 Call Girl service in Panaji☎️Panaji Call Gi...
jaspritkaur4u
 
一比一原版美国西雅图大学毕业证(Seattle毕业证书)毕业证成绩单留信认证
一比一原版美国西雅图大学毕业证(Seattle毕业证书)毕业证成绩单留信认证一比一原版美国西雅图大学毕业证(Seattle毕业证书)毕业证成绩单留信认证
一比一原版美国西雅图大学毕业证(Seattle毕业证书)毕业证成绩单留信认证
khuurq8kz
 
obat aborsi Klaten wa 082135199655 jual obat aborsi cytotec asli di Klaten
obat aborsi Klaten wa 082135199655 jual obat aborsi cytotec asli di Klatenobat aborsi Klaten wa 082135199655 jual obat aborsi cytotec asli di Klaten
obat aborsi Klaten wa 082135199655 jual obat aborsi cytotec asli di Klaten
siskavia95
 
obat aborsi klaten wa 081336238223 jual obat aborsi cytotec asli di klaten54-...
obat aborsi klaten wa 081336238223 jual obat aborsi cytotec asli di klaten54-...obat aborsi klaten wa 081336238223 jual obat aborsi cytotec asli di klaten54-...
obat aborsi klaten wa 081336238223 jual obat aborsi cytotec asli di klaten54-...
yulianti213969
 
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptxEngineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
DanielRemache4
 
Bhakti and Sufi Traditions from 8th to 18 th Century.pptx
Bhakti and Sufi Traditions from 8th to 18 th Century.pptxBhakti and Sufi Traditions from 8th to 18 th Century.pptx
Bhakti and Sufi Traditions from 8th to 18 th Century.pptx
kashvis
 
Captain america painting competition -- 13
Captain america painting competition -- 13Captain america painting competition -- 13
Captain america painting competition -- 13
Su Yan-Jen
 

Recently uploaded (20)

Reading 8 Artworks about books and readers
Reading 8 Artworks about books and readersReading 8 Artworks about books and readers
Reading 8 Artworks about books and readers
 
Jaro je tady - Spring is here (Judith) 4
Jaro je tady - Spring is here (Judith) 4Jaro je tady - Spring is here (Judith) 4
Jaro je tady - Spring is here (Judith) 4
 
ppt seni budaya kelas xi, menganalisis konsep,unsur,prinsip dan teknik
ppt seni budaya kelas xi, menganalisis konsep,unsur,prinsip dan teknikppt seni budaya kelas xi, menganalisis konsep,unsur,prinsip dan teknik
ppt seni budaya kelas xi, menganalisis konsep,unsur,prinsip dan teknik
 
Digital C-Type Printing: Revolutionizing The Future Of Photographic Prints
Digital C-Type Printing: Revolutionizing The Future Of Photographic PrintsDigital C-Type Printing: Revolutionizing The Future Of Photographic Prints
Digital C-Type Printing: Revolutionizing The Future Of Photographic Prints
 
SB_ Dragons Riders of Berk_ Rough_ RiverPhan (2024)
SB_ Dragons Riders of Berk_ Rough_ RiverPhan (2024)SB_ Dragons Riders of Berk_ Rough_ RiverPhan (2024)
SB_ Dragons Riders of Berk_ Rough_ RiverPhan (2024)
 
SB_ Pretzel and the puppies_ Rough_ RiverPhan (2024)
SB_ Pretzel and the puppies_ Rough_ RiverPhan (2024)SB_ Pretzel and the puppies_ Rough_ RiverPhan (2024)
SB_ Pretzel and the puppies_ Rough_ RiverPhan (2024)
 
SB_ Scott Pilgrim_ Rough_ RiverPhan (2024)
SB_ Scott Pilgrim_ Rough_ RiverPhan (2024)SB_ Scott Pilgrim_ Rough_ RiverPhan (2024)
SB_ Scott Pilgrim_ Rough_ RiverPhan (2024)
 
如何办理澳洲迪肯大学毕业证(Deakin毕业证书)毕业证成绩单原版一比一
如何办理澳洲迪肯大学毕业证(Deakin毕业证书)毕业证成绩单原版一比一如何办理澳洲迪肯大学毕业证(Deakin毕业证书)毕业证成绩单原版一比一
如何办理澳洲迪肯大学毕业证(Deakin毕业证书)毕业证成绩单原版一比一
 
💰Call Girl In Bhubaneswar☎️9777949614💰 Call Girl service in Bhubaneswar☎️Bhub...
💰Call Girl In Bhubaneswar☎️9777949614💰 Call Girl service in Bhubaneswar☎️Bhub...💰Call Girl In Bhubaneswar☎️9777949614💰 Call Girl service in Bhubaneswar☎️Bhub...
💰Call Girl In Bhubaneswar☎️9777949614💰 Call Girl service in Bhubaneswar☎️Bhub...
 
isodactylism_Diagram.pdf................
isodactylism_Diagram.pdf................isodactylism_Diagram.pdf................
isodactylism_Diagram.pdf................
 
一比一原版(MQU毕业证书)麦考瑞大学毕业证成绩单原件一模一样
一比一原版(MQU毕业证书)麦考瑞大学毕业证成绩单原件一模一样一比一原版(MQU毕业证书)麦考瑞大学毕业证成绩单原件一模一样
一比一原版(MQU毕业证书)麦考瑞大学毕业证成绩单原件一模一样
 
💰Call Girl In Panaji☎️90042XXXX7💰 Call Girl service in Panaji☎️Panaji Call Gi...
💰Call Girl In Panaji☎️90042XXXX7💰 Call Girl service in Panaji☎️Panaji Call Gi...💰Call Girl In Panaji☎️90042XXXX7💰 Call Girl service in Panaji☎️Panaji Call Gi...
💰Call Girl In Panaji☎️90042XXXX7💰 Call Girl service in Panaji☎️Panaji Call Gi...
 
一比一原版美国西雅图大学毕业证(Seattle毕业证书)毕业证成绩单留信认证
一比一原版美国西雅图大学毕业证(Seattle毕业证书)毕业证成绩单留信认证一比一原版美国西雅图大学毕业证(Seattle毕业证书)毕业证成绩单留信认证
一比一原版美国西雅图大学毕业证(Seattle毕业证书)毕业证成绩单留信认证
 
obat aborsi Klaten wa 082135199655 jual obat aborsi cytotec asli di Klaten
obat aborsi Klaten wa 082135199655 jual obat aborsi cytotec asli di Klatenobat aborsi Klaten wa 082135199655 jual obat aborsi cytotec asli di Klaten
obat aborsi Klaten wa 082135199655 jual obat aborsi cytotec asli di Klaten
 
obat aborsi klaten wa 081336238223 jual obat aborsi cytotec asli di klaten54-...
obat aborsi klaten wa 081336238223 jual obat aborsi cytotec asli di klaten54-...obat aborsi klaten wa 081336238223 jual obat aborsi cytotec asli di klaten54-...
obat aborsi klaten wa 081336238223 jual obat aborsi cytotec asli di klaten54-...
 
Sui Generis Magazine volume one Kristen Murillo.pdf
Sui Generis Magazine volume one Kristen Murillo.pdfSui Generis Magazine volume one Kristen Murillo.pdf
Sui Generis Magazine volume one Kristen Murillo.pdf
 
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptxEngineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
Engineering Major for College_ Environmental Health Engineering by Slidesgo.pptx
 
Bhakti and Sufi Traditions from 8th to 18 th Century.pptx
Bhakti and Sufi Traditions from 8th to 18 th Century.pptxBhakti and Sufi Traditions from 8th to 18 th Century.pptx
Bhakti and Sufi Traditions from 8th to 18 th Century.pptx
 
Magical World of Resin Art Creations.pdf
Magical World of Resin Art Creations.pdfMagical World of Resin Art Creations.pdf
Magical World of Resin Art Creations.pdf
 
Captain america painting competition -- 13
Captain america painting competition -- 13Captain america painting competition -- 13
Captain america painting competition -- 13
 

Test2

  • 1. Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting
  • 2. Topics Covered  Writing simple JavaScript programs.  Using input and output statements  Basic memory concepts.  Arithmetic operators.  Decision-making statements.  Relational and equality operators.
  • 3. Introduction  JavaScript scripting language – Client-side scripting enhances functionality and appearance  Makes pages more dynamic and interactive  Pages can produce immediate response without contacting a server  Customization is possible on the basis of users’ explicit and implicit input  Browser has to have a built-in (JavaScript) interpreter – Foundation for complex server-side scripting
  • 4. JavaScript: Object-Based Language  There are three object categories in JavaScript: Native Objects, Host Objects, and User-Defined Objects. – Native objects: defined by JavaScript.  String, Number, Array, Image, Date, Math, etc. – Host objects : supplied and always available to JavaScript by the browser environment.  window, document, forms, etc. – User-defined objects : defined by the author/programmer  Initially, we will use host objects created by the browser and their methods and properties
  • 5. Scripting  Two approaches to client side scripting: – Inline scripting  Written in the <body> section of a document – JavaScript code embedded in the <head> section
  • 6. Scripting  <script> tag  Indicate that the text is part of a script  type attribute – Specifies the type of file and the scripting language use:  Value: “text/javascript” – IE and Netscape use JavaScript as default scripting language  writeln method of the document object – Write a line in the document and position the cursor in the next line – Does not affect the actual rendering of the HTML document  What is being written by JavaScript is the set of html instructions that in turn determine the rendering of the html document
  • 7. Outline welcome.html (1 of 1) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 5 <!-- Fig. 7.1: welcome.html --> 6 <!-- Displaying a line of text --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>A First Program in JavaScript</title> 11 12 <script type = "text/javascript"> 13 <!-- 14 document.writeln( 15 "<h1>Welcome to JavaScript Programming!</h1>" ); 16 // --> 17 </script> 18 19 </head><body></body> 20 </html> HTML comment tags will result in skipping of the script by those browsers that do not support scripting
  • 8. Outline welcome2.html (1 of 1) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 5 <!-- Fig. 7.2: welcome2.html --> 6 <!-- Printing a Line with Multiple Statements --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>Printing a Line with Multiple Statements</title> 11 12 <script type = "text/javascript"> 13 <!-- 14 document.write( "<h1 style = "color: magenta">" ); 15 document.write( "Welcome to JavaScript " + 16 "Programming!</h1>" ); 17 // --> 18 </script> 19 20 </head><body></body> 21 </html> Escape character in combination with quotation mark: ” will result in insertion of a quotation mark in the string that is actually written by JavaScript
  • 9. Outline welcome3.html 1 of 1 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 5 <!-- Fig. 7.3: welcome3.html --> 6 <!-- Printing Multiple Lines --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head><title>Printing Multiple Lines</title> 10 11 <script type = "text/javascript"> 12 <!-- 13 document.writeln( "<h1>Welcome to<br />JavaScript" + 14 "<br />Programming!</h1>" ); 15 // --> 16 </script> 17 18 </head><body></body> 19 </html> New line of the html document in a browser is determined by an html <br /> element
  • 10. Outline welcome3.html 1 of 1 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4 5 <!-- Fig. 7.3: welcome3.html --> 6 <!-- Printing Multiple Lines --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head><title>Printing Multiple Lines</title> 10 11 <script type = "text/javascript"> 12 <!-- 13 document.writeln( "<h1>Welcome to<br />JavaScript" + 14 "<br />Programming!</h1>" ); 15 // --> 16 </script> 17 18 </head><body></body> 19 </html> New line of the html document in a browser is determined by an html <br /> element