web dev exam 5

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/28

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

29 Terms

1
New cards

which function does not display a dialogue box? window.open, window.prompt, window.alert, window.confirm

window.open

2
New cards
<p>how many parent and child elements does the ol element have?</p>

how many parent and child elements does the ol element have?

1 parent, 3 children

3
New cards

what is the only node that does not have a parent?

html node

4
New cards

What call is equivalent to document.getElementById("abc")?

document.querySelector(“#abc”);

5
New cards
<p>What is missing to change "Hello!" to "Hola!"?</p>

What is missing to change "Hello!" to "Hola!"?

para.innerHTML(if you want to use tags like bold or ul) or para.textContent (would just print out <em> as apposed to applying emphasis - considered to be safer from hackers)

6
New cards
<p>The code.js file contains a function called doSomething(). What happens when the browser processes the script tags?</p>

The code.js file contains a function called doSomething(). What happens when the browser processes the script tags?

code.js downloads first, then doSomething() is called

7
New cards
<p>What is assigned to para?</p>

What is assigned to para?

null

8
New cards
<p>What is missing to replace all paragraphs' text with "TEST"?</p>

What is missing to replace all paragraphs' text with "TEST"?

paras[i].textContent=”TEST”;

9
New cards
<p>What code is missing to change cat.jpg to dog.jpg?</p>

What code is missing to change cat.jpg to dog.jpg?

img.src=”dog.jpg”;

10
New cards

The DOMContentLoaded event occurs when _____.

all the HTML in the webpage has been processed

11
New cards

Which event occurs when the user changes the value of an input widget?

input

12
New cards
<p>Which call correctly adds a click event handler to the button?</p>

Which call correctly adds a click event handler to the button?

btn.addEventListener(“click”, sayHello);

13
New cards

window.alert()

displays dialog box with a message and ok button

14
New cards

window.confirm()

displays dialog box with OK and Cancel, returns bool

15
New cards

window.prompt()

displays dialog box with message and input field, returns null if user cancels

16
New cards

window.open()

opens new browser window with specified URL

17
New cards

async attribute

script is executed as soon as it’s downloaded, before entire HTML is parsed

18
New cards

defer attribute

used more often, waits until entire HTML doc is parsed

19
New cards

code minification

reduces unnecessary characters to reduce file size - takes out comments, line breaks, etc

20
New cards

code obfusication

makes code hard to read

21
New cards

how to use input

<input type="button" value="Click Me" id="mybutton">

22
New cards

how do you modify a node’s attribute?

node.attribute = “value”;

23
New cards

how do you remove an attribute in JavaScript

node.removeAttribute(“attribute”);

24
New cards

textContent vs innerHTML

textContent retrieves or sets the plain text of a node, innerHTML retrieves or sets the HTML markup within a node

25
New cards

how to get value of a textbox from input

document.getElementById("id").value

26
New cards

What does setTimeout() do in JavaScript?

setTimeout(eventHandler, millisecs) executes a function after a specified delay (in milliseconds).

27
New cards

What does clearTimeout() do in JavaScript?

clearTimeout(timerId) stops a timeout that was previously set using setTimeout()

28
New cards

What does setInterval() do in JavaScript?

setInterval(eventHandler, millisecs) repeatedly executes a function at a specified interval (in milliseconds).

29
New cards

What does clearInterval() do in JavaScript?

clearInterval(timerId) stops a repeated interval that was previously set using setInterval().