0% found this document useful (0 votes)
4 views3 pages

JavaScript Basics in HTML Documents

Chapter 5 discusses the integration of JavaScript into HTML documents, highlighting its role in adding interactivity. It covers basic syntax, including how to embed JavaScript using <SCRIPT> tags, and provides examples of single and multiple line comments, as well as variable declaration. Additionally, it briefly mentions arithmetic operators in JavaScript.

Uploaded by

devikas5331
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

JavaScript Basics in HTML Documents

Chapter 5 discusses the integration of JavaScript into HTML documents, highlighting its role in adding interactivity. It covers basic syntax, including how to embed JavaScript using <SCRIPT> tags, and provides examples of single and multiple line comments, as well as variable declaration. Additionally, it briefly mentions arithmetic operators in JavaScript.

Uploaded by

devikas5331
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 5

JAVA SCRIPT IN HTML DOCUMENTS

JavaScript is a scripting language with very simple syntax.


It helps to add interactive elements to HTML pages.
JavaScript programs usually embedded in HTML codes
with opening <SCRIPT> tag and the closing </SCRIPT>tag.
A simple javascript program
<HTML>
<HEAD>FIRST PROGRAM</HEAD>
<BODY>
<SCRIPT>
[Link](“Welcome to JavaScript”);
</ SCRIPT>
</HTML>
Comments in Javascript
1. Single line comment-Comments given in one line.
Double slash is used for this(//).
2. Multiple line comments-Comments given for multiple
[Link] block is enclosed between /* and */
Java script variables
<HTML>
<HEAD>FIRST PROGRAM</HEAD>
<BODY>
<SCRIPT>
Var name=”Ali”;
[Link](“Hello”+name+”<br>”How are you”);
</ SCRIPT>
</HTML>
Operators in Javascript
1Arithmetic operator

You might also like