JavaScript Reference
Methods
Apart f rom the metho ds listed in this section, you can also use the methods defined by
Node on any Elemen t o bject because Element is a subclass of Node.
getElementsByClassName()
Syntax:
element .getElementsByClassName(classNames )
See the d escription of the getElementsByClas sName () method of the Document
object on page 395.
getElementsByTagName()
Syntax:
element .getElementsByTagName(elementName )
See the description of the getElementsByTagName() method of the Document ob-
ject on page 395.
removeAttribute()
Syntax:
element .removeAttribute(attrName )
This method removes the attribute with the name attrName from element . Note
that attribute names are case insensitive.
Events
The Elem ent object defines a number of dierent event-handler properties represent-
ing various events that the browser fires on HTML elem ents. If you want to handle
a particula r event o n a pa rticular eleme nt, you simply set the corr esponding event-
handler property to the function you want to execute as a response to the event. Not
all events listed here are triggered on all elements, but because events bubble up the
document tree, the event-handler properties are universally defined fo r all elements
and even for Document and Window objects referred to by document and window.
The next table sums up some of th e event-ha ndler properties defined by the Element
object.
E.8. Element (Client-Side JavaScript) 401
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.131.47