Element Object Methods & Properties Flashcards

1
Q

Sets or returns the accesskey attribute of an element

A

element.accessKey

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Attaches an event handler to the specified element

A

element.addEventListener( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Adds a new child node, to an element, as the last child node

A

element.appendChild( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Returns a NamedNodeMap of an element’s attributes

A

element.attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Removes focus from an element

A

element.blur( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Returns the number of child elements an element has

A

element.childElementCount

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Returns a collection of an element’s child nodes (including text and comment nodes)

A

element.childNodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Returns a collection of an element’s child element (excluding text and comment nodes)

A

element.children

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Returns the class name(s) of an element

A

element.classList

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Sets or returns the value of the class attribute of an element

A

element.className

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Simulates a mouse-click on an element

A

element.click( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Returns the height of an element, including padding

A

element.clientHeight

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Returns the width of the left border of an element

A

element.clientLeft

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Returns the width of the top border of an element

A

element.clientTop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Returns the width of an element, including padding

A

element.clientWidth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Clones an element

A

element.contains( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Compares the document position of two elements

A

element.compareDocumentPosition( )

18
Q

Returns true if a node is a descendant of a node, othwerwise false

A

element.contains( )

19
Q

Sets or returns whether the content of an element is editable or not

A

element.contentEditable

20
Q

Sets or returns the value of the dir attribute of an element

A

element.dir

21
Q

Returns the first child node of an element

A

element.firstChild

22
Q

Returns the first child element of an element

A

element.firstElementChild

23
Q

Gives focus to an element

A

element.focus( )

24
Q

Returns the specified attribute value of an element node

A

element.getAttribute( )

25
Q

Returns the specified attribute node

A

element.getAttributeNode( )

26
Q

Returns a collection of all child elements with the specified class name

A

element.getElementsByClassName( )

27
Q

Returns a collection of all child elements with the specified tag name

A

element.getElementsByTagName( )

28
Q

Returns an object which implements the APIs of a specified feature

A

element.getFeature

29
Q

Returns true if an element has the specified attribute, otherwise false

A

element.hasAttribute( )

30
Q

Returns true if an element has any attributes, otherwise false

A

element.hasAttributes( )

31
Q

Returns true if an element has any child nodes, otherwise false

A

element.hasChildNodes( )

32
Q

Sets or returns the value of the id attribute of an element

A

element.id

33
Q

Sets or returns the content of an element

A

element.innerHTML

34
Q

Inserts a new child node before a specified, existing, child node

A

element.insertBefore( )

35
Q

Returns true if the content of an element is editable, otherwise false

A

element.isContentEditable

36
Q

Returns true if a specified namespaceURI is the default, otherwise false

A

element.isDefaultNamespace( )

37
Q

Checks if two elements are equal

A

element.isEqualNode( )

38
Q

Checks if two elements are the same node

A

element.isSameNode( )

39
Q

Returns true if a specified feature is supported on the element

A

element.isSupported( )

40
Q

Sets or returns the value of the lang attribute of an element

A

element.lang