SlideShare a Scribd company logo
4
Most read
7
Most read
9
Most read
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

PPT
Introduction to CSS
PPTX
COMPILER DESIGN
PPTX
Lect6 Association rule & Apriori algorithm
PPT
definitions of sociology
PPTX
Diabetes Mellitus
PPTX
Hypertension
PPTX
Republic Act No. 11313 Safe Spaces Act (Bawal Bastos Law).pptx
PPTX
Power Point Presentation on Artificial Intelligence
Introduction to CSS
COMPILER DESIGN
Lect6 Association rule & Apriori algorithm
definitions of sociology
Diabetes Mellitus
Hypertension
Republic Act No. 11313 Safe Spaces Act (Bawal Bastos Law).pptx
Power Point Presentation on Artificial Intelligence

What's hot (20)

DOCX
Vb.net class notes
PPT
PPT
Applet Architecture - Introducing Java Applets
PPTX
HTML frames and HTML forms
PPT
Javascript
PPTX
Event In JavaScript
PPT
Active Server Page(ASP)
PPTX
Notification android
PDF
Internet programming lecture 1
PPTX
Multiple Access Protocal
PPTX
Overloading and overriding in vb.net
PPTX
Presentation of bootstrap
PDF
Java Programming :Event Handling(Types of Events)
PPT
4 internet programming
PPT
Ch 3 event driven programming
PPTX
Cookie & Session In ASP.NET
PPTX
Architectural styles and patterns
PPS
Java rmi
PPT
android menus
PPTX
Cascading Style Sheet (CSS)
Vb.net class notes
Applet Architecture - Introducing Java Applets
HTML frames and HTML forms
Javascript
Event In JavaScript
Active Server Page(ASP)
Notification android
Internet programming lecture 1
Multiple Access Protocal
Overloading and overriding in vb.net
Presentation of bootstrap
Java Programming :Event Handling(Types of Events)
4 internet programming
Ch 3 event driven programming
Cookie & Session In ASP.NET
Architectural styles and patterns
Java rmi
android menus
Cascading Style Sheet (CSS)
Ad

Viewers also liked (20)

PPT
Dynamic HTML Event Model
PPT
Dynamic HTML
PPTX
Dhtml sohaib ch
PPTX
PPTX
Dynamic HTML (DHTML)
PPTX
Dreamweawer
KEY
TinyMCE: WYSIWYG editor 2010-12-08
PPTX
Normalization in DBMS
PDF
Introduction of The Dream Weavers
PDF
171dreamweaver
PPT
Normalization
DOCX
Report Normalization documents
PDF
WYSIWYG Is a Lie
PPT
Normalization
PDF
Introduction to Dreamweaver
PPTX
Penerbitan video korporat
PPTX
Dreamweaver - Introduction AND WALKTHROUGH
PPTX
13. session 13 introduction to dhtml
PPTX
14. session 14 dhtml filter
PPTX
Dynamic HTML Event Model
Dynamic HTML
Dhtml sohaib ch
Dynamic HTML (DHTML)
Dreamweawer
TinyMCE: WYSIWYG editor 2010-12-08
Normalization in DBMS
Introduction of The Dream Weavers
171dreamweaver
Normalization
Report Normalization documents
WYSIWYG Is a Lie
Normalization
Introduction to Dreamweaver
Penerbitan video korporat
Dreamweaver - Introduction AND WALKTHROUGH
13. session 13 introduction to dhtml
14. session 14 dhtml filter
Ad

Similar to DHTML - Events & Buttons (20)

PPTX
JavaScript_Events.pptx
PDF
JavaScript - Chapter 11 - Events
PDF
The Fine Art of JavaScript Event Handling
PPTX
JavaScript_Event_Handling_Presentation.pptx
PPTX
types of events in JS
PPTX
5 .java script events
PPTX
Javascript event handler
PPTX
Mobile Application Development class 005
PPTX
Unit-III_JQuery.pptx engineering subject for third year students
PPTX
JavaScript_Event_Handling_Updated_______
PPTX
B2. activity and intent
PPTX
Upstate CSCI 450 WebDev Chapter 9
PDF
Introj Query Pt2
PDF
JavaScript
PDF
JavaScript
PPTX
Event handling in Java(part 1)
PPTX
tL20 event handling
PPT
Multi Touch And Gesture Event Interface And Types
PDF
Events.pdf
PPTX
Lesson 205 07 oct13-1500-ay
JavaScript_Events.pptx
JavaScript - Chapter 11 - Events
The Fine Art of JavaScript Event Handling
JavaScript_Event_Handling_Presentation.pptx
types of events in JS
5 .java script events
Javascript event handler
Mobile Application Development class 005
Unit-III_JQuery.pptx engineering subject for third year students
JavaScript_Event_Handling_Updated_______
B2. activity and intent
Upstate CSCI 450 WebDev Chapter 9
Introj Query Pt2
JavaScript
JavaScript
Event handling in Java(part 1)
tL20 event handling
Multi Touch And Gesture Event Interface And Types
Events.pdf
Lesson 205 07 oct13-1500-ay

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Institutional Correction lecture only . . .
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Pre independence Education in Inndia.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Complications of Minimal Access Surgery at WLH
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Cell Structure & Organelles in detailed.
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Insiders guide to clinical Medicine.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
master seminar digital applications in india
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Anesthesia in Laparoscopic Surgery in India
Institutional Correction lecture only . . .
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Pre independence Education in Inndia.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Complications of Minimal Access Surgery at WLH
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
01-Introduction-to-Information-Management.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Cell Structure & Organelles in detailed.
Supply Chain Operations Speaking Notes -ICLT Program
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Abdominal Access Techniques with Prof. Dr. R K Mishra
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Insiders guide to clinical Medicine.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPH.pptx obstetrics and gynecology in nursing
master seminar digital applications in india
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx

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>