www.webdeveloper.com
Results 1 to 2 of 2

Thread: ok guys new prob

  1. #1
    Join Date
    Jan 2003
    Location
    houston tx
    Posts
    79

    ok guys new prob

    i need to know how i can find out which object recived an event. i do know that there is an event object in the window object but im not sure how to use it. any help would be great, or an exmple would be great thanx
    Last edited by z_mirza; 06-05-2003 at 09:46 PM.

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,123
    for a general use on whole of the page,you can set the document to recieve click events

    The code snippet below is tested(IE6+,NS6+ &opera7+).


    function clickHandler(e){
    var events = (document.all)?event:e;
    //now you can get the event source
    var esrc = (document.all)?event.srcElement:e.target;
    alert(esrc.nodeName)
    }

    if(!document.all){//ns6+
    document.captureEvents(Event.CLICK);
    }
    document.onclick=clickHandler;
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles