JavaScript Tutorial/Event/srcElement

Материал из Web эксперт
Версия от 11:24, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Get event source element name and id

   <source lang="javascript">

<html> <head> <title>A Simple Page</title> <script language="JavaScript">

</script> </head> <body onMouseover="tagInfo()" id="body1">

Heading One

Some text

Another heading

More text and some bold text

Another heading

More text and some italics text

</body> </html></source>


window.event.srcElement.tagName

   <source lang="javascript">

<html> <head> <title>A Simple Page</title> <script language="JavaScript">

</script> </head> <body onMouseover="tagInfo()">

Heading One

Some text

Another heading

More text and some bold text

Another heading

More text and some italics text

</body> </html></source>