Page 262 - Web_Application_v2.0_C12_Fb
P. 262

</SCRIPT>
                  </HEAD>

                  <BODY>
                  <p onmouseout="resetColor(this)" style="color: red;">Move mouse away from this
                      text</p>
                  </BODY>
                  </HTML>
              Output:











              Example 68: To demonstrate the use of  onmousemove event

                  <!DOCTYPE HTML>
                  <HTML>
                  <HEAD>

                  <TITLE>JavaScript onmousemove</TITLE>
                  </HEAD>
                  <SCRIPT>
                  function showCoords(event) {
                  alert("Mouse coordinates: X=" + event.clientX + ", Y=" + event.clientY);
                  }

                  </SCRIPT>
                  </HEAD>
                  <BODY>
                  <div onmousemove="showCoords(event)" style="border:1px solid black; width:200px;
                      height:100px;">
                  Move your mouse inside this box

                  </div>
                  </BODY>
                  </HTML>
              Output:

















                260   Touchpad Web Applications (Ver. 2.0)-XII
   257   258   259   260   261   262   263   264   265   266   267