Home arrow JavaScript arrow Page 4 - OnLoad and OnMouse JavaScript Events
JAVASCRIPT

OnLoad and OnMouse JavaScript Events


In our last article we left off with the OnKeyUp function, which is triggered when a user releases a key on the keyboard. We will continue discussing the various JavaScript events in this article, and hopefully finish them in the next tutorial. So grab yourself some coffee and let’s get to work.

Author Info:
By: James Payne
Rating: 3 stars3 stars3 stars3 stars3 stars / 14
December 10, 2007
TABLE OF CONTENTS:
  1. · OnLoad and OnMouse JavaScript Events
  2. · OnMouse Events
  3. · OnMouseMove
  4. · OnMouseOut
  5. · OnMouseOver
  6. · OnMouseUp

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
OnLoad and OnMouse JavaScript Events - OnMouseOut
(Page 4 of 6 )

The OnMouseOut event is triggered when you move your mouse away from an element. In the sample below there are several things that happen when the user moves their mouse away from an element. First, the user enters text into the Enter Your Name text box. If the user moves their mouse away from the box, two things happen: first, all of the letters are made uppercase. Second, a pop-up box appears telling them that this has happened.

Next, if the user moves their mouse away from the Come Here button, a pop-up alert will appear begging them: "Please don’t leave me!"


<html>

<head>

<script type="text/javascript">

function upperCase()

{

var x=document.getElementById("name").value

document.getElementById("name").value=x.toUpperCase()

alert('I uppercased you!')

}

</script>

</head>


<body>

Enter your name: <input type="text" id="name" onmouseout="upperCase()"><br /><br /> <br />

<input type="submit" id="Don't leave me!" value= "Come Here" onmouseout="alert(this.id)">


</body>

</html>

Supporting HTML tags: <a>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, <button>, <caption>, <cite>, <code>, <dd>, <dfn>, <div>, <dl>, <dt>, <em>, <fieldset>, <form>, <h1> to <h6>, <hr>, <i>, <img>, <input>, <kbd>, <label>, <legend>, <li>, <map>, <ol>, <p>, <pre>, <samp>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <tt>, <ul>, <var>

Supporting Javascript Objects: layer, link


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials