SlideShare une entreprise Scribd logo
1  sur  10
JavaScript Document Object :
       ondblclick (Event handler)
Description
The ondblclick event handler of a document
  object executes some JavaScript code or
  function when the pointing device (for
  example mouse) button is double clicked over
  the document object.
EXAMPLE                  BROWSER’S OUTPUT
<HTML>
<body
  bottommargin=150
  ondblclick="alert('d
  ouble clicked!')">
  <p>Double-click
  anywhere in the
  page.</p>
</body>
</HTML>
Keyboard Events:
The onkeydown event occurs when the user is pressing a key (on the
   keyboard).
Tip: The order of events related to the onkeydown event:
   a. onkeydown--A key is pressed down.
   b. onkeypress --A character key is pressed
   c. onkeyup-- A key is released.

There is a fundamental difference between keypress and keydown.

Keydown ------triggers on any key press and gives scan-code.
Keypress ------triggers after key down and gives char-code, but it is
guaranteed for character keys only.
<html><head>        EXAMPLE            BROWSER’S OUTPUT
<script>
function myFunction()
{
alert("You pressed a key inside the
   input field");
}
</script>
</head>
<body>
<p>A function is triggered when
   the user is pressing a key in the
   input field.</p>
<input type="text"
   onkeydown="myFunction()">
</body>
</html>
MOUSE EVENTS
The onmousedown event occurs when a user presses a
  mouse button over an element.
Tip: The order of events related to the onmousedown
  event (for the left/middle mouse button):
onmousedown
onmouseup
onclick
The order of events related to the onmousedown event
  (for the right mouse button):
onmousedown
onmouseup
oncontextmenu
EXAMPLE                 BROWSER’S OUTPUT
<html><head>
<script>
function myFunction(elmnt,clr)
{
elmnt.style.color=clr;
}
</script>
                                                On this example, when
</head><body>                                   the text was click it was
<p onmousedown="myFunction(this,'red')"         change to green, but
onmouseup="myFunction(this,'green')">           when mouse button was
Click the text to change the color. A           pressed down it was
                                                change to red, when the
function, with parameters, is triggered when
                                                mouse button was
the mouse button is pressed down, and           released or press up it
again, with other parameters, when the          returns to green.
mouse button is released.
</p>
</body></html>
Form onreset and onsubmit Event


• The onreset event occurs when
  the reset button in a form is clicked.
• The onsubmit event occurs when
  the submit button in a form is
  clicked.
EXAMPLE    BROWSER’S OUTPUT
<html><body>
<p>Enter some text in the fields
   below, then press the Reset
   button to reset the form.</p>
<form onreset="alert('The form
   will be reset')">
Firstname: <input type="text"
   name="fname"
   value="Donald"><br>
Lastname: <input type="text"
   name="lname" value="Duck">
<br><br>
<input type="reset"
   value="Reset">
</form>
</body></html
EXAMPLE
<html><head><script>         <body>
function greeting()          What is your name?<br>
                             <form name="frm1"
{
                             action="tryjsref_form_onsubmit.ht
alert("Welcome " +           m" onsubmit="greeting()">
   document.forms["frm1"     <input type="text"
   ]["fname"].value + "!")   name="fname">
}                            <input type="submit"
</script>                    value="Submit">
                             </form>
</head>
                             </body>
    BROWSER’S OUTPUT         </html>

Contenu connexe

Tendances

How to setting e mail signatures
How to setting e mail signaturesHow to setting e mail signatures
How to setting e mail signaturesDanai Thongsin
 
5 .java script events
5 .java script   events5 .java script   events
5 .java script eventschauhankapil
 
types of events in JS
types of events in JS types of events in JS
types of events in JS chauhankapil
 
Google Chrome tips and tricks
Google Chrome tips and tricksGoogle Chrome tips and tricks
Google Chrome tips and tricksOradea Tech Hub
 
How to send a big file using dropbox
How to send a big file using dropboxHow to send a big file using dropbox
How to send a big file using dropboxlouie Tuboro
 
Web Presentations, deck.js and Extensions
Web Presentations, deck.js and ExtensionsWeb Presentations, deck.js and Extensions
Web Presentations, deck.js and Extensionsremiemonet
 
keyboard shortcut for windows remote desktop
keyboard shortcut for windows remote desktopkeyboard shortcut for windows remote desktop
keyboard shortcut for windows remote desktopSireesh K
 
Microsoft windows command prompt
Microsoft windows command promptMicrosoft windows command prompt
Microsoft windows command promptAbdulqadir001
 
Cara cepat pakai keyboard
Cara cepat pakai keyboardCara cepat pakai keyboard
Cara cepat pakai keyboardSukron Firudin
 

Tendances (13)

How to setting e mail signatures
How to setting e mail signaturesHow to setting e mail signatures
How to setting e mail signatures
 
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
 
1
11
1
 
Google Chrome tips and tricks
Google Chrome tips and tricksGoogle Chrome tips and tricks
Google Chrome tips and tricks
 
How to send a big file using dropbox
How to send a big file using dropboxHow to send a big file using dropbox
How to send a big file using dropbox
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Web Presentations, deck.js and Extensions
Web Presentations, deck.js and ExtensionsWeb Presentations, deck.js and Extensions
Web Presentations, deck.js and Extensions
 
keyboard shortcut for windows remote desktop
keyboard shortcut for windows remote desktopkeyboard shortcut for windows remote desktop
keyboard shortcut for windows remote desktop
 
Microsoft windows command prompt
Microsoft windows command promptMicrosoft windows command prompt
Microsoft windows command prompt
 
52 100 keyboard_shortcuts
52 100 keyboard_shortcuts52 100 keyboard_shortcuts
52 100 keyboard_shortcuts
 
Cara cepat pakai keyboard
Cara cepat pakai keyboardCara cepat pakai keyboard
Cara cepat pakai keyboard
 

En vedette

Asp.net event handler
Asp.net event handlerAsp.net event handler
Asp.net event handlerSireesh K
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5sotlsoc
 
Css color and background properties
Css color and background propertiesCss color and background properties
Css color and background propertiesJesus Obenita Jr.
 
Unit iii css and javascript 1
Unit iii css and javascript 1Unit iii css and javascript 1
Unit iii css and javascript 1Jesus Obenita Jr.
 
Designing static pages using html formatting text
Designing static pages using html  formatting textDesigning static pages using html  formatting text
Designing static pages using html formatting textJesus Obenita Jr.
 
Designing web pages html videos
Designing web pages html videosDesigning web pages html videos
Designing web pages html videosJesus Obenita Jr.
 
Javascript alert and confrim box
Javascript alert and confrim boxJavascript alert and confrim box
Javascript alert and confrim boxJesus Obenita Jr.
 
Word 2013 working with pictures
Word 2013 working with picturesWord 2013 working with pictures
Word 2013 working with picturesJesus Obenita Jr.
 
JavaScript-Events_CertificateOfCompletion
JavaScript-Events_CertificateOfCompletionJavaScript-Events_CertificateOfCompletion
JavaScript-Events_CertificateOfCompletionSandip Das
 
Html web designing linking pages
Html web designing linking pagesHtml web designing linking pages
Html web designing linking pagesJesus Obenita Jr.
 
Ms excel 2013 data management
Ms excel 2013 data managementMs excel 2013 data management
Ms excel 2013 data managementJesus Obenita Jr.
 
Understanding the basics of web design 3pptx
Understanding the basics of web design 3pptxUnderstanding the basics of web design 3pptx
Understanding the basics of web design 3pptxJesus Obenita Jr.
 

En vedette (20)

Asp.net event handler
Asp.net event handlerAsp.net event handler
Asp.net event handler
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5
 
Powerpoint
PowerpointPowerpoint
Powerpoint
 
Css color and background properties
Css color and background propertiesCss color and background properties
Css color and background properties
 
Microsoft word
Microsoft wordMicrosoft word
Microsoft word
 
Unit iii css and javascript 1
Unit iii css and javascript 1Unit iii css and javascript 1
Unit iii css and javascript 1
 
Designing static pages using html formatting text
Designing static pages using html  formatting textDesigning static pages using html  formatting text
Designing static pages using html formatting text
 
Greek God and Goddesses
Greek God and GoddessesGreek God and Goddesses
Greek God and Goddesses
 
Microsoft PowerPoint
Microsoft PowerPointMicrosoft PowerPoint
Microsoft PowerPoint
 
Java scriptfunction
Java scriptfunctionJava scriptfunction
Java scriptfunction
 
Designing web pages html videos
Designing web pages html videosDesigning web pages html videos
Designing web pages html videos
 
Javascript alert and confrim box
Javascript alert and confrim boxJavascript alert and confrim box
Javascript alert and confrim box
 
Word 2013 working with pictures
Word 2013 working with picturesWord 2013 working with pictures
Word 2013 working with pictures
 
JavaScript-Events_CertificateOfCompletion
JavaScript-Events_CertificateOfCompletionJavaScript-Events_CertificateOfCompletion
JavaScript-Events_CertificateOfCompletion
 
Chapter iv computer virus
Chapter iv  computer virusChapter iv  computer virus
Chapter iv computer virus
 
Html web designing linking pages
Html web designing linking pagesHtml web designing linking pages
Html web designing linking pages
 
Javascript validating form
Javascript validating formJavascript validating form
Javascript validating form
 
Ms excel 2013 data management
Ms excel 2013 data managementMs excel 2013 data management
Ms excel 2013 data management
 
EKONOMIKS
EKONOMIKSEKONOMIKS
EKONOMIKS
 
Understanding the basics of web design 3pptx
Understanding the basics of web design 3pptxUnderstanding the basics of web design 3pptx
Understanding the basics of web design 3pptx
 

Similaire à JavaScript Document Object ondblclick Event Handler

Similaire à JavaScript Document Object ondblclick Event Handler (20)

Web 5 | JavaScript Events
Web 5 | JavaScript EventsWeb 5 | JavaScript Events
Web 5 | JavaScript Events
 
JavaScript-L20.pptx
JavaScript-L20.pptxJavaScript-L20.pptx
JavaScript-L20.pptx
 
Html tag
Html tagHtml tag
Html tag
 
Java script programms
Java script programmsJava script programms
Java script programms
 
Java script errors &amp; exceptions handling
Java script  errors &amp; exceptions handlingJava script  errors &amp; exceptions handling
Java script errors &amp; exceptions handling
 
Java script events
Java script  eventsJava script  events
Java script events
 
DHTML - Events & Buttons
DHTML - Events  & ButtonsDHTML - Events  & Buttons
DHTML - Events & Buttons
 
Events Lecture Notes
Events Lecture NotesEvents Lecture Notes
Events Lecture Notes
 
course js day 3
course js day 3course js day 3
course js day 3
 
Java Script
Java ScriptJava Script
Java Script
 
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireUn-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
 
ReactJS
ReactJSReactJS
ReactJS
 
Yahoo presentation: JavaScript Events
Yahoo presentation: JavaScript EventsYahoo presentation: JavaScript Events
Yahoo presentation: JavaScript Events
 
Javascript event handler
Javascript event handlerJavascript event handler
Javascript event handler
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
 
20180921 #24 we_are_javascripters
20180921 #24 we_are_javascripters20180921 #24 we_are_javascripters
20180921 #24 we_are_javascripters
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
Function calling in js
Function calling in jsFunction calling in js
Function calling in js
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
 
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.154.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15
 

Plus de Jesus Obenita Jr.

Plus de Jesus Obenita Jr. (20)

Organization and management 3 a Evolution of Management Theory
Organization and management 3 a Evolution of Management TheoryOrganization and management 3 a Evolution of Management Theory
Organization and management 3 a Evolution of Management Theory
 
Organization and management 2 Management Function
Organization and management 2 Management FunctionOrganization and management 2 Management Function
Organization and management 2 Management Function
 
Organization and management 1
Organization and management 1Organization and management 1
Organization and management 1
 
Designing web page marquee and img tag
Designing web page  marquee and img tagDesigning web page  marquee and img tag
Designing web page marquee and img tag
 
Ms excel 2013 formatting worksheets
Ms excel 2013 formatting worksheetsMs excel 2013 formatting worksheets
Ms excel 2013 formatting worksheets
 
Microsoft Excel introduction
Microsoft Excel introductionMicrosoft Excel introduction
Microsoft Excel introduction
 
Word 2013 Formatting Page
Word 2013 Formatting PageWord 2013 Formatting Page
Word 2013 Formatting Page
 
Word 2013 8
Word 2013 8Word 2013 8
Word 2013 8
 
Ms word 2013 7
Ms word 2013 7Ms word 2013 7
Ms word 2013 7
 
Ms word 2013 6
Ms word 2013 6Ms word 2013 6
Ms word 2013 6
 
Ms word 2013 4
Ms word 2013 4Ms word 2013 4
Ms word 2013 4
 
Ms word 2013 2
Ms word 2013 2Ms word 2013 2
Ms word 2013 2
 
Ms word 2013
Ms word 2013Ms word 2013
Ms word 2013
 
Parts of the ms word 2013 screen and
Parts of the ms word 2013 screen andParts of the ms word 2013 screen and
Parts of the ms word 2013 screen and
 
Word processor
Word processorWord processor
Word processor
 
Session 2 test construction.mt's
Session 2   test construction.mt'sSession 2   test construction.mt's
Session 2 test construction.mt's
 
Cooking ingredients
Cooking ingredientsCooking ingredients
Cooking ingredients
 
Color theory
Color theoryColor theory
Color theory
 
Computer software
Computer softwareComputer software
Computer software
 
Computer software
Computer softwareComputer software
Computer software
 

Dernier

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Dernier (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

JavaScript Document Object ondblclick Event Handler

  • 1.
  • 2. JavaScript Document Object : ondblclick (Event handler) Description The ondblclick event handler of a document object executes some JavaScript code or function when the pointing device (for example mouse) button is double clicked over the document object.
  • 3. EXAMPLE BROWSER’S OUTPUT <HTML> <body bottommargin=150 ondblclick="alert('d ouble clicked!')"> <p>Double-click anywhere in the page.</p> </body> </HTML>
  • 4. Keyboard Events: The onkeydown event occurs when the user is pressing a key (on the keyboard). Tip: The order of events related to the onkeydown event: a. onkeydown--A key is pressed down. b. onkeypress --A character key is pressed c. onkeyup-- A key is released. There is a fundamental difference between keypress and keydown. Keydown ------triggers on any key press and gives scan-code. Keypress ------triggers after key down and gives char-code, but it is guaranteed for character keys only.
  • 5. <html><head> EXAMPLE BROWSER’S OUTPUT <script> function myFunction() { alert("You pressed a key inside the input field"); } </script> </head> <body> <p>A function is triggered when the user is pressing a key in the input field.</p> <input type="text" onkeydown="myFunction()"> </body> </html>
  • 6. MOUSE EVENTS The onmousedown event occurs when a user presses a mouse button over an element. Tip: The order of events related to the onmousedown event (for the left/middle mouse button): onmousedown onmouseup onclick The order of events related to the onmousedown event (for the right mouse button): onmousedown onmouseup oncontextmenu
  • 7. EXAMPLE BROWSER’S OUTPUT <html><head> <script> function myFunction(elmnt,clr) { elmnt.style.color=clr; } </script> On this example, when </head><body> the text was click it was <p onmousedown="myFunction(this,'red')" change to green, but onmouseup="myFunction(this,'green')"> when mouse button was Click the text to change the color. A pressed down it was change to red, when the function, with parameters, is triggered when mouse button was the mouse button is pressed down, and released or press up it again, with other parameters, when the returns to green. mouse button is released. </p> </body></html>
  • 8. Form onreset and onsubmit Event • The onreset event occurs when the reset button in a form is clicked. • The onsubmit event occurs when the submit button in a form is clicked.
  • 9. EXAMPLE BROWSER’S OUTPUT <html><body> <p>Enter some text in the fields below, then press the Reset button to reset the form.</p> <form onreset="alert('The form will be reset')"> Firstname: <input type="text" name="fname" value="Donald"><br> Lastname: <input type="text" name="lname" value="Duck"> <br><br> <input type="reset" value="Reset"> </form> </body></html
  • 10. EXAMPLE <html><head><script> <body> function greeting() What is your name?<br> <form name="frm1" { action="tryjsref_form_onsubmit.ht alert("Welcome " + m" onsubmit="greeting()"> document.forms["frm1" <input type="text" ]["fname"].value + "!") name="fname"> } <input type="submit" </script> value="Submit"> </form> </head> </body> BROWSER’S OUTPUT </html>