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
Returns the specified attribute node
element.getAttributeNode( )
26
Returns a collection of all child elements with the specified class name
element.getElementsByClassName( )
27
Returns a collection of all child elements with the specified tag name
element.getElementsByTagName( )
28
Returns an object which implements the APIs of a specified feature
element.getFeature
29
Returns true if an element has the specified attribute, otherwise false
element.hasAttribute( )
30
Returns true if an element has any attributes, otherwise false
element.hasAttributes( )
31
Returns true if an element has any child nodes, otherwise false
element.hasChildNodes( )
32
Sets or returns the value of the id attribute of an element
element.id
33
Sets or returns the content of an element
element.innerHTML
34
Inserts a new child node before a specified, existing, child node
element.insertBefore( )
35
Returns true if the content of an element is editable, otherwise false
element.isContentEditable
36
Returns true if a specified namespaceURI is the default, otherwise false
element.isDefaultNamespace( )
37
Checks if two elements are equal
element.isEqualNode( )
38
Checks if two elements are the same node
element.isSameNode( )
39
Returns true if a specified feature is supported on the element
element.isSupported( )
40
Sets or returns the value of the lang attribute of an element
element.lang