SlideShare une entreprise Scribd logo
1  sur  18
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

Contenu connexe

Tendances

Tendances (20)

Dom
DomDom
Dom
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Servlets
ServletsServlets
Servlets
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Web technology lab manual
Web technology lab manualWeb technology lab manual
Web technology lab manual
 
Html frames
Html framesHtml frames
Html frames
 
jQuery
jQueryjQuery
jQuery
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Popup boxes
Popup boxesPopup boxes
Popup boxes
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Js ppt
Js pptJs ppt
Js ppt
 
Simple object access protocol(soap )
Simple object access protocol(soap )Simple object access protocol(soap )
Simple object access protocol(soap )
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 

En vedette

Introduction of The Dream Weavers
Introduction of The Dream WeaversIntroduction of The Dream Weavers
Introduction of The Dream Weavers
The Dream Weavers
 
Normalization
NormalizationNormalization
Normalization
JTHSICT
 
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 Đỗ
 

En vedette (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
 

Similaire à DHTML - Events & Buttons

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
 
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
 

Similaire à 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
 
5 .java script events
5 .java script   events5 .java script   events
5 .java script events
 
types of events in JS
types of events in JS types of events in JS
types of events in JS
 
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#
 
The touch events
The touch eventsThe touch events
The touch events
 
Javascript Browser Events.pdf
Javascript Browser Events.pdfJavascript Browser Events.pdf
Javascript Browser Events.pdf
 

Dernier

Dernier (20)

Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

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>