Saturday, 2024-11-16, 10:16 AM
Welcome Guest | RSS
Site menu
Tag Board
500
Our poll
How is .Net classes by R.N.Reddy sir ?
Total of answers: 243
Statistics

Total online: 5
Guests: 5
Users: 0
29-12-2010

event.type: Here type is a property of event object, it is representing the firing event name.
    <html>
       <head>
              <script type = "textscript">
              function whichevent(event)
             {
                 alert("The firing event name is " +event.type)
             }
             </script>
        </head>
        <body onmousedown= "whichevent(event)">
        </body>
    </html>
Output:


Onkeyup: This event will fire or execut when user is releasing the pressed key from the keyboard.

Eg: for onkeyup event:
    <html>
       <head>
           <script type = "text/javascript">
           function whenevent(event)
          {
              alert("The firing event name is " +event.type)
          }
          </sccript>
       </head>
       <body onkeyup= "whichevent(event)">
       </body>
    </html>
Output:


Eg: To display the ASCII value:

event.keycode: It is aproperty of event object.
keycode is representing the ACII value or unicode value of the pressed key from the keyboard.
    <html>
       <head>
           <script type = "text/javascript">
           function unicodevalue(event)
          {
              alert("unicode value of pressed key is " +event.keycode)
          }
          </script>
          </head>
          <body onkeyup= "unicode value(event)">
          </body>
    </html>
Output:


Eg: To display x & y coordinate values:

event.clientX: ClientX is a property of event object, it is representing the x chords value.

event.clientY: Here clientY is a property of event object. It is representing the y chords value.


Eg:   <html>
            <head>
                 <script type = "text/javascript">
                  function display(event)
                 {
                      var x = event.clientX
                      var y = event.clientY
                      alert("X value is " +x ", Y value is " +y)
                 }
                 </script>
           </head>
           <body onmousedown= "display(event)">
           </body>
    </html>
Output: X value is 101, Y value is 208

getElementById(): It is a method of document object.

Using this method we can access an html element by using html Id.

Eg: For getElementById():
     <html>
         <head>
              <script type = "text/javascript">
              function getelement()
              {
                 var x = document.getElementById("myheader")
                 alert("The element tag name is " +x.tagname)
              }
             </script>
         </head>
         <body>
             <h1 id = "myheader" onclick= "getelement()"> Microsoft Windows <h1>
         </body>
     </html>
Output:


Search

Time
 

 

Calendar
 
«  November 2024  »
SuMoTuWeThFrSa
     12
3456789
10111213141516
17181920212223
24252627282930

Twitter
 

Entries archive

Copyright R N Reddy © 2024Developed by Nagendra, Venkat, Vijaya and Yaswanth
Get free updates as SMS to your mobile. Just register by clicking here