SlideShare a Scribd company logo
Web technology
Active Learning Assessment
Submitted By:
Deep Patel
130410107064
TY CE II
B Batch
DHTML: Events & Buttons
Active Learning Assessment
What is DHTML?
• DHTML is NOT a language.
• DHTML is a TERM describing the art of making dynamic and
interactive web pages.
• DHTML combines HTML, JavaScript, the HTML DOM, and CSS.
• According to the World Wide Web Consortium (W3C):
"Dynamic HTML is a term used by some vendors to describe the
combination of HTML, style sheets and scripts that allows documents
to be animated."
Events & Buttons
• Events are the actions that the user performs when they visit your
page.
• They may, for example move the mouse around or click on buttons.
• When an event happens it triggers objects that are associated with
that kind of event.
• Event Handlers catch these events and execute code in response.
• Events can be classified into 4 categories for ease of understanding:
1. Window Events
2. Mouse Events
3. Keyboard Events
4. Form Events
Window Events
• The Window itself has its own events, which trigger when a new page
is starting up (onLoad), shutting down (onUnload),being resized
(onResize), moved (onMove), canceled (onAbort) or when an error
occurs (onError).
• There is also an event triggered when the window moves to
foreground (onFocus) or changes to background (onBlur).
Mouse Events
• The mouse has a few events associated with it when a button is
pressed (onMousedown) on top of an element and when it is
released (onMouseup);
• When the mouse moves and the pointer is already over an element
(onMousemove) and when it moves away from the element
(onMouseout).
• Events are triggered also when the pointer is over an element
(onMouseover) and when it is clicked once (onClick) or twice
(onDblclick).
Keyboard Events
• Events can be triggered when the key is pressed down (onKeydown)
and when it is released (onKeyup).
• The complete key sequence, down press and up release, triggers
another event (onKeypress).
Form Events
• Events can be triggered when the reset button on the form is clicked
(onReset) or when the submit button is clicked (onSubmit).
• Even when a content is selected on a page (onSelect) event is
generated.
Events
Event When does it happen?
onabort Visitor aborts page loading
onblur Visitor leaves an object
onchange Visitor changes the value of an object
onclick Visitor clicks on an object
ondblclick Visitor double clicks on an object
onfocus Visitor makes an object active
onkeydown Key is being pressed down
onkeypress Key is pressed
onkeyup Key is being released
onload Page has finished loading
onmousedown User presses a mouse button
onmousemove Cursor moves on an object
onmouseout Cursor moves off an object
onmouseover Cursor moves over an object
onmouseup Visitor releases a mouse button
onreset Visitor resets a form
onselect Visitor selects a content on a page
onsubmit Visitor submits a form
onunload Visitor closes a page
Using Events
• Each of the events can be used to trigger scripts to run. Below
mentioned script shows how it is possible to trap the exiting of the
user from a page.
<html>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”>
</script>
</head>
<body onUnload=“alert(‘Bye, see you again!’)”>
<h1>Hello!</h1>
</body>
</html>
Using a Mouse click & Button for events
• This script uses the button to trigger a function that will output "Hello World" in a
p element with id=“demo’.
<html>
<body>
<button onclick="myFunction()">Click me</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
</body>
</html>
Using Mouse over and Mouse out
• The event of mouse passing into and out of an element is captured.
<html>
<body bgcolor=“green”>
<h1 onmouseover=“style.color=‘yellow’"
onmouseout="style.color=‘black’”>Hover here!</h1>
</body>
</html>
More Mouse Events
<html>
<body>
<p id="p1" onmousedown="mouseDown()" onmouseup="mouseUp()">Click the text! </p>
<script>
function mouseDown() {
document.getElementById("p1").style.color = "red";
}
function mouseUp() {
document.getElementById("p1").style.color = "green";
}
</script>
</body>
</html>
Using Keyboard events
• A function is triggered when the user is pressing a key in
the input field.
<html>
<body>
<input type="text" onkeypress="myFunction()">
<script>
function myFunction() {
alert("You pressed a key inside the input field");
}
</script>
</body>
</html>
Using Form Events
• When you submit the form, a function is triggered which alerts some text.
<html>
<body>
<form onsubmit="myFunction()">
Enter name: <input type="text" name="fname">
<input type="submit" value="Submit">
</form>
<script>
function myFunction() {
alert("The form was submitted");
}
</script>
</body>
</html>
Thank You!
Bibliography
• http://www.w3schools.com/tags/ref_eventattributes.asp
• Developing Web Applications – Ralph Moseley

More Related Content

What's hot

JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
javascript objects
javascript objectsjavascript objects
javascript objects
Vijay Kalyan
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
WebStackAcademy
 
Html5-Web-Storage
Html5-Web-StorageHtml5-Web-Storage
Html5-Web-Storage
Mindfire Solutions
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
Knoldus Inc.
 
JavaScript - Chapter 14 - Form Handling
 JavaScript - Chapter 14 - Form Handling   JavaScript - Chapter 14 - Form Handling
JavaScript - Chapter 14 - Form Handling
WebStackAcademy
 
Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascript
zahid7578
 
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
Dhruvin Nakrani
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
AakankshaR
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
Ravi Bhadauria
 
JavaScript Data Types
JavaScript Data TypesJavaScript Data Types
JavaScript Data Types
Charles Russell
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
WebStackAcademy
 
Html form tag
Html form tagHtml form tag
Html form tag
shreyachougule
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
Vineet Kumar Saini
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Ravinder Kamboj
 
Html
HtmlHtml
Ajax
AjaxAjax
Ajax
Tech_MX
 
PHP variables
PHP  variablesPHP  variables
PHP variables
Siddique Ibrahim
 
Servlet life cycle
Servlet life cycleServlet life cycle
Servlet life cycle
Venkateswara Rao N
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
teach4uin
 

What's hot (20)

JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
 
Html5-Web-Storage
Html5-Web-StorageHtml5-Web-Storage
Html5-Web-Storage
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
JavaScript - Chapter 14 - Form Handling
 JavaScript - Chapter 14 - Form Handling   JavaScript - Chapter 14 - Form Handling
JavaScript - Chapter 14 - Form Handling
 
Unit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascriptUnit ii java script and xhtml documents and dynamic documents with javascript
Unit ii java script and xhtml documents and dynamic documents with javascript
 
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 
JavaScript Data Types
JavaScript Data TypesJavaScript Data Types
JavaScript Data Types
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
 
Html form tag
Html form tagHtml form tag
Html form tag
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html
HtmlHtml
Html
 
Ajax
AjaxAjax
Ajax
 
PHP variables
PHP  variablesPHP  variables
PHP variables
 
Servlet life cycle
Servlet life cycleServlet life cycle
Servlet life cycle
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 

Viewers also liked

Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
Reem Alattas
 
Dynamic HTML
Dynamic HTMLDynamic HTML
Dynamic HTML
Vinil Patel
 
Dhtml sohaib ch
Dhtml sohaib chDhtml sohaib ch
Dhtml sohaib ch
Sohaib Chaudhery
 
Dhtml
DhtmlDhtml
Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)
Himanshu Kumar
 
Dreamweawer
DreamweawerDreamweawer
Dreamweawer
aditi sharma
 
TinyMCE: WYSIWYG editor 2010-12-08
TinyMCE: WYSIWYG editor 2010-12-08TinyMCE: WYSIWYG editor 2010-12-08
TinyMCE: WYSIWYG editor 2010-12-08
Andy Gelme
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Prateek Parimal
 
Introduction of The Dream Weavers
Introduction of The Dream WeaversIntroduction of The Dream Weavers
Introduction of The Dream Weavers
The Dream Weavers
 
171dreamweaver
171dreamweaver171dreamweaver
171dreamweaver
Sourabh Vashistha
 
Normalization
NormalizationNormalization
Normalization
JTHSICT
 
Report Normalization documents
Report Normalization documentsReport Normalization documents
Report Normalization documents
Wakil Kumar
 
WYSIWYG Is a Lie
WYSIWYG Is a LieWYSIWYG Is a Lie
WYSIWYG Is a Lie
arborwebsolutions
 
Normalization
NormalizationNormalization
Normalization
Jigisha Pandya
 
Introduction to Dreamweaver
Introduction to DreamweaverIntroduction to Dreamweaver
Introduction to Dreamweaver
Sarah Bombich
 
Penerbitan video korporat
Penerbitan video korporatPenerbitan video korporat
Penerbitan video korporat
Hazrul Halim
 
Dreamweaver - Introduction AND WALKTHROUGH
Dreamweaver - Introduction AND WALKTHROUGHDreamweaver - Introduction AND WALKTHROUGH
Dreamweaver - Introduction AND WALKTHROUGH
Sahil Bansal
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtml
Phúc Đỗ
 
14. session 14 dhtml filter
14. session 14   dhtml filter14. session 14   dhtml filter
14. session 14 dhtml filter
Phúc Đỗ
 
DHTML
DHTMLDHTML

Viewers also liked (20)

Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
 
Dynamic HTML
Dynamic HTMLDynamic HTML
Dynamic HTML
 
Dhtml sohaib ch
Dhtml sohaib chDhtml sohaib ch
Dhtml sohaib ch
 
Dhtml
DhtmlDhtml
Dhtml
 
Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)
 
Dreamweawer
DreamweawerDreamweawer
Dreamweawer
 
TinyMCE: WYSIWYG editor 2010-12-08
TinyMCE: WYSIWYG editor 2010-12-08TinyMCE: WYSIWYG editor 2010-12-08
TinyMCE: WYSIWYG editor 2010-12-08
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Introduction of The Dream Weavers
Introduction of The Dream WeaversIntroduction of The Dream Weavers
Introduction of The Dream Weavers
 
171dreamweaver
171dreamweaver171dreamweaver
171dreamweaver
 
Normalization
NormalizationNormalization
Normalization
 
Report Normalization documents
Report Normalization documentsReport Normalization documents
Report Normalization documents
 
WYSIWYG Is a Lie
WYSIWYG Is a LieWYSIWYG Is a Lie
WYSIWYG Is a Lie
 
Normalization
NormalizationNormalization
Normalization
 
Introduction to Dreamweaver
Introduction to DreamweaverIntroduction to Dreamweaver
Introduction to Dreamweaver
 
Penerbitan video korporat
Penerbitan video korporatPenerbitan video korporat
Penerbitan video korporat
 
Dreamweaver - Introduction AND WALKTHROUGH
Dreamweaver - Introduction AND WALKTHROUGHDreamweaver - Introduction AND WALKTHROUGH
Dreamweaver - Introduction AND WALKTHROUGH
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtml
 
14. session 14 dhtml filter
14. session 14   dhtml filter14. session 14   dhtml filter
14. session 14 dhtml filter
 
DHTML
DHTMLDHTML
DHTML
 

Similar to DHTML - Events & Buttons

JavaScript_Events.pptx
JavaScript_Events.pptxJavaScript_Events.pptx
JavaScript_Events.pptx
Yagna15
 
The Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingThe Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event Handling
Yorick Phoenix
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
ShahDhruv21
 
types of events in JS
types of events in JS types of events in JS
types of events in JS
chauhankapil
 
5 .java script events
5 .java script   events5 .java script   events
5 .java script events
chauhankapil
 
Javascript event handler
Javascript event handlerJavascript event handler
Javascript event handler
Jesus Obenita Jr.
 
Mobile Application Development class 005
Mobile Application Development class 005Mobile Application Development class 005
Mobile Application Development class 005
Dr. Mazin Mohamed alkathiri
 
B2. activity and intent
B2. activity and intentB2. activity and intent
B2. activity and intent
PERKYTORIALS
 
Upstate CSCI 450 WebDev Chapter 9
Upstate CSCI 450 WebDev Chapter 9Upstate CSCI 450 WebDev Chapter 9
Upstate CSCI 450 WebDev Chapter 9
DanWooster1
 
Introj Query Pt2
Introj Query Pt2Introj Query Pt2
Introj Query Pt2
kshyju
 
JavaScript
JavaScriptJavaScript
JavaScript
tutorialsruby
 
JavaScript
JavaScriptJavaScript
JavaScript
tutorialsruby
 
Event handling in Java(part 1)
Event handling in Java(part 1)Event handling in Java(part 1)
Event handling in Java(part 1)
RAJITHARAMACHANDRAN1
 
tL20 event handling
tL20 event handlingtL20 event handling
tL20 event handling
teach4uin
 
Multi Touch And Gesture Event Interface And Types
Multi Touch And Gesture Event Interface And TypesMulti Touch And Gesture Event Interface And Types
Multi Touch And Gesture Event Interface And Types
Ethan Cha
 
Events.pdf
Events.pdfEvents.pdf
Events.pdf
stephanedjeukam1
 
Lesson 205 07 oct13-1500-ay
Lesson 205 07 oct13-1500-ayLesson 205 07 oct13-1500-ay
Lesson 205 07 oct13-1500-ay
Codecademy Ren
 
Tips for building fast multi touch enabled web sites
 Tips for building fast multi touch enabled web sites Tips for building fast multi touch enabled web sites
Tips for building fast multi touch enabled web sites
Aspenware
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
Fast multi touch enabled web sites
Aspenware
 
Session 5#
Session 5#Session 5#
Session 5#
Mohamed Samir
 

Similar to DHTML - Events & Buttons (20)

JavaScript_Events.pptx
JavaScript_Events.pptxJavaScript_Events.pptx
JavaScript_Events.pptx
 
The Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event HandlingThe Fine Art of JavaScript Event Handling
The Fine Art of JavaScript Event Handling
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
types of events in JS
types of events in JS types of events in JS
types of events in JS
 
5 .java script events
5 .java script   events5 .java script   events
5 .java script events
 
Javascript event handler
Javascript event handlerJavascript event handler
Javascript event handler
 
Mobile Application Development class 005
Mobile Application Development class 005Mobile Application Development class 005
Mobile Application Development class 005
 
B2. activity and intent
B2. activity and intentB2. activity and intent
B2. activity and intent
 
Upstate CSCI 450 WebDev Chapter 9
Upstate CSCI 450 WebDev Chapter 9Upstate CSCI 450 WebDev Chapter 9
Upstate CSCI 450 WebDev Chapter 9
 
Introj Query Pt2
Introj Query Pt2Introj Query Pt2
Introj Query Pt2
 
JavaScript
JavaScriptJavaScript
JavaScript
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Event handling in Java(part 1)
Event handling in Java(part 1)Event handling in Java(part 1)
Event handling in Java(part 1)
 
tL20 event handling
tL20 event handlingtL20 event handling
tL20 event handling
 
Multi Touch And Gesture Event Interface And Types
Multi Touch And Gesture Event Interface And TypesMulti Touch And Gesture Event Interface And Types
Multi Touch And Gesture Event Interface And Types
 
Events.pdf
Events.pdfEvents.pdf
Events.pdf
 
Lesson 205 07 oct13-1500-ay
Lesson 205 07 oct13-1500-ayLesson 205 07 oct13-1500-ay
Lesson 205 07 oct13-1500-ay
 
Tips for building fast multi touch enabled web sites
 Tips for building fast multi touch enabled web sites Tips for building fast multi touch enabled web sites
Tips for building fast multi touch enabled web sites
 
Fast multi touch enabled web sites
Fast multi touch enabled web sitesFast multi touch enabled web sites
Fast multi touch enabled web sites
 
Session 5#
Session 5#Session 5#
Session 5#
 

Recently uploaded

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
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
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
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
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
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
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
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
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
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
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
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
 

Recently uploaded (20)

PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
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
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
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...
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
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...
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
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
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
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
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
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
 

DHTML - Events & Buttons

  • 1. Web technology Active Learning Assessment Submitted By: Deep Patel 130410107064 TY CE II B Batch
  • 2. DHTML: Events & Buttons Active Learning Assessment
  • 3. What is DHTML? • DHTML is NOT a language. • DHTML is a TERM describing the art of making dynamic and interactive web pages. • DHTML combines HTML, JavaScript, the HTML DOM, and CSS. • According to the World Wide Web Consortium (W3C): "Dynamic HTML is a term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated."
  • 4. Events & Buttons • Events are the actions that the user performs when they visit your page. • They may, for example move the mouse around or click on buttons. • When an event happens it triggers objects that are associated with that kind of event. • Event Handlers catch these events and execute code in response.
  • 5. • Events can be classified into 4 categories for ease of understanding: 1. Window Events 2. Mouse Events 3. Keyboard Events 4. Form Events
  • 6. Window Events • The Window itself has its own events, which trigger when a new page is starting up (onLoad), shutting down (onUnload),being resized (onResize), moved (onMove), canceled (onAbort) or when an error occurs (onError). • There is also an event triggered when the window moves to foreground (onFocus) or changes to background (onBlur).
  • 7. Mouse Events • The mouse has a few events associated with it when a button is pressed (onMousedown) on top of an element and when it is released (onMouseup); • When the mouse moves and the pointer is already over an element (onMousemove) and when it moves away from the element (onMouseout). • Events are triggered also when the pointer is over an element (onMouseover) and when it is clicked once (onClick) or twice (onDblclick).
  • 8. Keyboard Events • Events can be triggered when the key is pressed down (onKeydown) and when it is released (onKeyup). • The complete key sequence, down press and up release, triggers another event (onKeypress).
  • 9. Form Events • Events can be triggered when the reset button on the form is clicked (onReset) or when the submit button is clicked (onSubmit). • Even when a content is selected on a page (onSelect) event is generated.
  • 10. Events Event When does it happen? onabort Visitor aborts page loading onblur Visitor leaves an object onchange Visitor changes the value of an object onclick Visitor clicks on an object ondblclick Visitor double clicks on an object onfocus Visitor makes an object active onkeydown Key is being pressed down onkeypress Key is pressed onkeyup Key is being released
  • 11. onload Page has finished loading onmousedown User presses a mouse button onmousemove Cursor moves on an object onmouseout Cursor moves off an object onmouseover Cursor moves over an object onmouseup Visitor releases a mouse button onreset Visitor resets a form onselect Visitor selects a content on a page onsubmit Visitor submits a form onunload Visitor closes a page
  • 12. Using Events • Each of the events can be used to trigger scripts to run. Below mentioned script shows how it is possible to trap the exiting of the user from a page. <html> <head> <meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”> </script> </head> <body onUnload=“alert(‘Bye, see you again!’)”> <h1>Hello!</h1> </body> </html>
  • 13. Using a Mouse click & Button for events • This script uses the button to trigger a function that will output "Hello World" in a p element with id=“demo’. <html> <body> <button onclick="myFunction()">Click me</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = "Hello World"; } </script> </body> </html>
  • 14. Using Mouse over and Mouse out • The event of mouse passing into and out of an element is captured. <html> <body bgcolor=“green”> <h1 onmouseover=“style.color=‘yellow’" onmouseout="style.color=‘black’”>Hover here!</h1> </body> </html>
  • 15. More Mouse Events <html> <body> <p id="p1" onmousedown="mouseDown()" onmouseup="mouseUp()">Click the text! </p> <script> function mouseDown() { document.getElementById("p1").style.color = "red"; } function mouseUp() { document.getElementById("p1").style.color = "green"; } </script> </body> </html>
  • 16. Using Keyboard events • A function is triggered when the user is pressing a key in the input field. <html> <body> <input type="text" onkeypress="myFunction()"> <script> function myFunction() { alert("You pressed a key inside the input field"); } </script> </body> </html>
  • 17. Using Form Events • When you submit the form, a function is triggered which alerts some text. <html> <body> <form onsubmit="myFunction()"> Enter name: <input type="text" name="fname"> <input type="submit" value="Submit"> </form> <script> function myFunction() { alert("The form was submitted"); } </script> </body> </html>