Document Flashcards

1
Q

The DOM specification is called ___

A

Document Living Standard

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

What is DOM

A

DOM is the Document Object Model.
It represents all elements on the page as objects for manipulation.
the ‘document’ object is the main entry point to the page.

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

Which model is used to represent CSS?

A

CSSOM(CSS Object model)

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

What is BOM?

A

Additional objects provided by browser, not part of DOM

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

this property holds information about the current browser

A

navigator.userAgent

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

this property holds information about the browser

A

navigator.platform

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

navigate the window to new url ___

A

location.href = /* new url */

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

Which Object Model do alert/confirm/prompt belong to? DOM, BOM or CSSOM?

A

BOM, they are browser properties.

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

this tag forms the root in DOM tree structure

A

document

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

this console command highlights the element in the page

A

inspect(node)

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

what are corresponding DOM elements for , , and tags?

A

document.documentElement || document.head || document.body

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

In reference to DOM, childNodes is an array. True / False ?

A

False. It is a collection, not an array.

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

childNodes holds all nodes even comments, text, etc. True/False ?

A

True. Text and Comment are also nodes.

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

Predict the output:

document. documentElement.parentNode ||
document. documentElement.parentElement

A

document || null

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

document is the object of this Node class

A

HTMLDocument

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

The abstract class providing parentNode, nextSibling, and childNodes is ___

A

Node

17
Q

The class providing nextElementSibling, children, getElementsByTagName, querySelector is ___

A

Element

18
Q

EventTarget Class does not derive from any class. true or false ?

A

false.

It derives from Object class.

19
Q

3 ways of seeing the DOM node class name

A

document.body.constructor.name
alert(document.body)
document.body instanceof HTMLElement

20
Q

console.dir does what ?

A

shows the element as a DOM object, not its DOM tree

21
Q

element.nodeType returns ___

A

the numeric value corresponding to type of node

22
Q

difference between tagName and nodeName

A
tagName = exists for Element Nodes
nodeName = exists for All types of nodes.
23
Q

If we enter a script using innerHTML will it execute?

A

No. It is just embedded in HTML, not executed.

24
Q

document.append(…) adds an element node to the document. True / False ?

A

False. append will work on document.body, not document as document encompasses all elements within it.

25
Q

geometry properties are calculated for elements that are not displayed. True or False ?

A

False. they are null/zero for properties that are not displayed.

26
Q

elements of CSS box model from inside to outside

A

content - padding - border - margin

27
Q

these two elements of the css box model are transparent

A

padding and margin

28
Q

scrollBarWidth + contentWidth = ?

A

CSS width

29
Q

offSetParent is null for these 3 types of elements

A

display: none;
and ;
position:fixed;

30
Q

The scroll bar shares an edge with ___

A

the border of the element

31
Q

To accommodate scroll bar, the browser reduces this width ___

A

contentWidth

32
Q

which element would you refer to to get properties of the entire window?

A

document.documentElement NOT window.

33
Q

this window property in Safari only needs to be accessed differently.

A

scrollLeft/Top
Safari needs —> document.body.scrollLeft/Top
Others —> document.documentElement.scrollLeft/top

34
Q

list mouse events in browser

A

click, contextmenu, mouserover, mouseout,mousedown, mouseup, mousemove

35
Q

list keyboard events in browser

A

keyup and keydown

36
Q

form element events

A

submit and focus

37
Q

DOMContentLoaded is fired upon ___

A

fully loading all html, and creating DOM elements.