In this section we're going to examine element events. Each element in a page can fire (or invoke) a variety of events. By default neither of these events is attached. You've to add an event handler explicitly. To add a handler you need to have an element's instance first.
To get the instance you retrieve an element through these ways:
GetElementsByTagName
method to get all elements of specific type (such as, all hyperlinks).GetElementById
method, to get a specific element. That implies the element has its Id
attribute set.ElementDom
property to walk the document object model's hierarchy to reach the element you want.In this exercise you use the Tab [Control], group [Element Events] to attach events to elements below: