[thelist] What does event.srcElement.innerText refer to?

James Aylard evolt at pixelwright.com
Tue Oct 28 13:03:13 CST 2003

Chris George wrote:

> In my quest for JS knowledge, I came across this
> event.srcElement.innerText that I'm not sure what it does.

    It references the innerText property of the element that initiated a
particular event. srcElement is, I believe, IE-proprietary, but others
correct me if I'm wrong. You could, for instance, write a script like this:

<script type="text/javascript" for="document" event="onclick()">
   var el ;
   el = window.event.srcElement ;
   if ("TD" == el.tagName)
      alert(el.innerText) ; // lame, I know; but you get the idea.

James Aylard

More information about the thelist mailing list