R N REDDY .Net Community - ASP
Sunday, 2016-12-04, 11:51 PM
Welcome Guest | RSS
Site menu
Tag Board
500
Our poll
Which .Net class is more interset for you ?
Total of answers: 209
Statistics

Total online: 1
Guests: 1
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
 
«  December 2016  »
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
25262728293031

Twitter
 

Entries archive

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