SlideShare a Scribd company logo
JavaScript
Special Notes
There are several main tags and elements
used in JavaScript, including:
•<script>: The <script> tag is used to
include JavaScript code in an HTML
document. The code can be written
directly in the <script> tag or linked to
an external JavaScript file using the
"src" attribute.
There are several main tags and elements
used in JavaScript, including:
•Variables: Variables are used to store
data in JavaScript. They can be
declared using the "var", "let", or
"const" keywords followed by the
variable name.
There are several main tags and elements
used in JavaScript, including:
•Functions: Functions are blocks of code
that can be reused throughout a
program. They are defined using the
"function" keyword followed by the
function name and any parameters.
There are several main tags and elements
used in JavaScript, including:
•Conditional Statements: Conditional
statements are used to perform
different actions based on different
conditions. The most commonly used
conditional statements in JavaScript are
"if", "else if", and "else".
There are several main tags and elements
used in JavaScript, including:
•Loops: Loops are used to repeat a
block of code until a specific
condition is met. The most
commonly used loops in JavaScript
are "for", "while", and "do-while".
There are several main tags and elements
used in JavaScript, including:
•Objects: Objects are used to store
collections of data and functions.
They are defined using curly braces
{} and can have properties and
methods.
There are several main tags and elements
used in JavaScript, including:
•Arrays: Arrays are used to store
collections of data in JavaScript. They
are defined using square brackets [] and
can hold any data type, including other
arrays.
• <!doctype html>
• <html>
• <head>
• <meta charset="utf-8">
• <title>Untitled
Document</title>
• </head>
• <body>
•
• <div id="demo" onclick="raju()">
• Click me
• </div>
• <script>
• function raju()
• {
• document.getElementById("demo")
.innerHTML = "I have changed!";
• const myElement =
document.getElementById("demo")
;
• myElement.style.color = "red";
• }
• </script>
•
• </body>
• </html>
• <!doctype html>
• <html>
• <head>
• <meta charset="utf-8">
• <title>Untitled
Document</title>
• </head>
• <body>
•
• <div id="demo" onclick="raju()">
• Click me
• </div>
• <script>
• function raju()
• {
•
document.getElementById("demo")
.innerHTML = "I have changed!";
• }
• </script>
•
• </body>
• </html>
•<!doctype html>
•<html>
•<head>
•<meta charset="utf-
8">
•<title>Untitled
Document</title>
•</head>
•<body>
• <script
type="text/javascript">
•
document.write("Welc
ome to <br><b>St.Mary's
College</b>");
• </script>
•
• </body>
• </html>
• <!doctype html>
• <html>
• <head>
• <meta charset="utf-8">
• <title>Untitled
Document</title>
• </head>
• <body>
• <div id="demo"><!--
onclick="myFunction()" -->
• Click me
• </div>
• <script>
•
document.getElementById
("demo").innerHTML = "I
have changed!";
• </script>
• <!-- function
myFunction() { -->
• </body>
• </html>
End Coding
Vinoy Johny

More Related Content

Similar to JavaScript Variables, Event, Button and Action

BITM3730Week6.pptx
BITM3730Week6.pptxBITM3730Week6.pptx
BITM3730Week6.pptx
MattMarino13
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
Knoldus Inc.
 
Javascript
JavascriptJavascript
Javascript
Mozxai
 
Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
koppenolski
 
Java script
Java scriptJava script
Java script
Ravinder Kamboj
 
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
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
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
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
Placement and variable 03 (js)
Placement and variable 03 (js)Placement and variable 03 (js)
Placement and variable 03 (js)
AbhishekMondal42
 
Javascript
JavascriptJavascript
Javascript
Prashant Kumar
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
Gil Fink
 
lecture 6 javascript event and event handling.ppt
lecture 6 javascript event and event handling.pptlecture 6 javascript event and event handling.ppt
lecture 6 javascript event and event handling.ppt
ULADATZ
 
Java script
Java scriptJava script
Java script
Jay Patel
 
Java Script
Java ScriptJava Script
Java Script
Sarvan15
 
Java Script
Java ScriptJava Script
Java Script
Sarvan15
 
Webdev bootcamp
Webdev bootcampWebdev bootcamp
Webdev bootcamp
DSCMESCOE
 
Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2
GDSCUniversitasMatan
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Jussi Pohjolainen
 
Html,CSS & UI/UX design
Html,CSS & UI/UX designHtml,CSS & UI/UX design
Html,CSS & UI/UX design
Karthikeyan Dhanasekaran CUA
 
Dsc Charusat Learning React Part 1
Dsc Charusat Learning React Part 1 Dsc Charusat Learning React Part 1
Dsc Charusat Learning React Part 1
JainamMehta19
 
JSTL.pptx
JSTL.pptxJSTL.pptx
JSTL.pptx
SPAMVEDANT
 

Similar to JavaScript Variables, Event, Button and Action (20)

BITM3730Week6.pptx
BITM3730Week6.pptxBITM3730Week6.pptx
BITM3730Week6.pptx
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Javascript
JavascriptJavascript
Javascript
 
Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
 
Java script
Java scriptJava script
Java script
 
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
 
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
 
Placement and variable 03 (js)
Placement and variable 03 (js)Placement and variable 03 (js)
Placement and variable 03 (js)
 
Javascript
JavascriptJavascript
Javascript
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
lecture 6 javascript event and event handling.ppt
lecture 6 javascript event and event handling.pptlecture 6 javascript event and event handling.ppt
lecture 6 javascript event and event handling.ppt
 
Java script
Java scriptJava script
Java script
 
Java Script
Java ScriptJava Script
Java Script
 
Java Script
Java ScriptJava Script
Java Script
 
Webdev bootcamp
Webdev bootcampWebdev bootcamp
Webdev bootcamp
 
Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2Bootcamp - Web Development Session 2
Bootcamp - Web Development Session 2
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Html,CSS & UI/UX design
Html,CSS & UI/UX designHtml,CSS & UI/UX design
Html,CSS & UI/UX design
 
Dsc Charusat Learning React Part 1
Dsc Charusat Learning React Part 1 Dsc Charusat Learning React Part 1
Dsc Charusat Learning React Part 1
 
JSTL.pptx
JSTL.pptxJSTL.pptx
JSTL.pptx
 

Recently uploaded

Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 

Recently uploaded (20)

Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 

JavaScript Variables, Event, Button and Action

  • 2. There are several main tags and elements used in JavaScript, including: •<script>: The <script> tag is used to include JavaScript code in an HTML document. The code can be written directly in the <script> tag or linked to an external JavaScript file using the "src" attribute.
  • 3. There are several main tags and elements used in JavaScript, including: •Variables: Variables are used to store data in JavaScript. They can be declared using the "var", "let", or "const" keywords followed by the variable name.
  • 4. There are several main tags and elements used in JavaScript, including: •Functions: Functions are blocks of code that can be reused throughout a program. They are defined using the "function" keyword followed by the function name and any parameters.
  • 5. There are several main tags and elements used in JavaScript, including: •Conditional Statements: Conditional statements are used to perform different actions based on different conditions. The most commonly used conditional statements in JavaScript are "if", "else if", and "else".
  • 6. There are several main tags and elements used in JavaScript, including: •Loops: Loops are used to repeat a block of code until a specific condition is met. The most commonly used loops in JavaScript are "for", "while", and "do-while".
  • 7. There are several main tags and elements used in JavaScript, including: •Objects: Objects are used to store collections of data and functions. They are defined using curly braces {} and can have properties and methods.
  • 8. There are several main tags and elements used in JavaScript, including: •Arrays: Arrays are used to store collections of data in JavaScript. They are defined using square brackets [] and can hold any data type, including other arrays.
  • 9. • <!doctype html> • <html> • <head> • <meta charset="utf-8"> • <title>Untitled Document</title> • </head> • <body> • • <div id="demo" onclick="raju()"> • Click me • </div> • <script> • function raju() • { • document.getElementById("demo") .innerHTML = "I have changed!"; • const myElement = document.getElementById("demo") ; • myElement.style.color = "red"; • } • </script> • • </body> • </html>
  • 10. • <!doctype html> • <html> • <head> • <meta charset="utf-8"> • <title>Untitled Document</title> • </head> • <body> • • <div id="demo" onclick="raju()"> • Click me • </div> • <script> • function raju() • { • document.getElementById("demo") .innerHTML = "I have changed!"; • } • </script> • • </body> • </html>
  • 11. •<!doctype html> •<html> •<head> •<meta charset="utf- 8"> •<title>Untitled Document</title> •</head> •<body> • <script type="text/javascript"> • document.write("Welc ome to <br><b>St.Mary's College</b>"); • </script> • • </body> • </html>
  • 12. • <!doctype html> • <html> • <head> • <meta charset="utf-8"> • <title>Untitled Document</title> • </head> • <body> • <div id="demo"><!-- onclick="myFunction()" --> • Click me • </div> • <script> • document.getElementById ("demo").innerHTML = "I have changed!"; • </script> • <!-- function myFunction() { --> • </body> • </html>