HTML
HTML Basic
HTML Tags
HTML Formatting
HTML Attributes
HTML & Styles
HTML & Scripts
HTML Tables
HTML Lists
HTML Links
HTML Forms
HTML Images
HTML Meta Tags
HTML Layout
HTML Doctypes
HTML CSS
HTML Head
HTML Scripts
HTML Entities
HTML Encoding
HTML5
HTML5 Basic
HTML5 Tags
HTML5 Input Types
HTML5 Video
HTML5 Audio
HTML5 Drag and Drop
HTML5 Canvas
HTML5 SVG
HTML5 Geolocation
CSS
CSS Basic
Applying CSS
CSS Selectors
CSS Colors
CSS Text & Fonts
CSS Borders
CSS Align
CSS Margins & Padding
CSS Grouping & Nesting
CSS Positioning
CSS Floating
CSS Dimension
CSS Display
CSS Pseudo
CSS3
CSS3 Basic
CSS3 Selectors
CSS3 Shadows
CSS3 Gradients
CSS3 Transitions
CSS3 Animations
CSS3 @Font Face
CSS3 Rounded Corners
CSS3 Multi Columns
CSS3 Flexible Box
CSS3 Transform
JavaScript
JS Basic
JS Keywords
JS Statements
JS Variables
JS Operators
JS Functions
JS Objects
JS Guidelines
JS Comparisons
JS If...Else
JS Switch
JS Loop
JS Events
JS Try...Catch
JS Browser Objects
JS Cookies
JS Validation
JS Timer
JS Objects
jQuery
jQuery Core
jQuery Selectors
jQuery Attributes
jQuery Traversing
jQuery Manipulation
jQuery Events
jQuery CSS
jQuery Effects
jQuery Ajax
jQuery Plugins
jQuery Animations
jQuery Utilities
References
HTML References
HTML 5 References
CSS References
CSS3 References
JavaScript References
HTML Code References
Ascii Code References
URL Encode & URL Decode
HTML Encode & HTML Decode
HTML to Text
Home
Javascript
Events
Previous chapter (JavaScript Language - Loop)
Next chapter (JavaScript Language - Trycatch)
JavaScript Click and Mouse Events
Javascript Events are the actions which are detected by the javascript when they are fired.
Other examples in Events (JavaScript Language)
JavaScript Click and Mouse Events
JavaScript onLoad and Unload Events
JavaScript Keyboard Events
JavaScript onfocus Event
JavaScript Submit Event
JavaScript onselect Event
Result from the Online TryIt-Editor
<!doctype html> <html> <head> <title>HtmlNest.com live html example</title> <script type="text/javascript"> function message() { alert("You clicked me!") } function mdown() { document.getElementById("heading1").style.backgroundColor = "red"; } function mmove() { document.getElementById("heading2").style.fontSize = "26px"; } function mout() { document.getElementById("heading2").style.fontSize = "18px"; } function mover() { document.getElementById("heading3").style.color = "red"; } function mup() { document.getElementById("heading3").style.color = "blue"; } </script> </head> <body> <input type="button" onclick="message()" value="Click once" /> <p> A function is called when the button is clicked. The function gives a message. </p> <br /> <input type="button" value="Double Click" ondblclick="message()" /> <p> A function is called when the button is double clicked. The function gives a message. </p> <br /> <h3 onmousedown="mdown()" id="heading1"> When you Press the mouse on this heading the background color will change. </h3> <br /> <h3 onmousemove="mmove()" onmouseout="mout()" id="heading2"> When you move the mouse on this heading the size of the text will increase and when mouse out the text size will decrease. </h3> <br /> <h3 onmouseover="mover()" onmouseup="mup()" id="heading3"> When you move the mouse pointer on this heading the color of text will change to red and when the mouse pointer out the color will change to blue. </h3> <br /> </body> </html>
1.0
1.0
1.0
3.0
4.0
Useful Information
Contact
Privacy Policy
Copyright 2014 htmlnest.com.
All Rights Reserved.