Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

CSCI 215 EXAM 2 UPDATED ACTUAL QUESTIONS AND CORRECT ANSWERS

Document preview thumbnail
Preview 2 out of 7 pages

CSCI 215 EXAM 2 UPDATED ACTUAL QUESTIONS AND CORRECT ANSWERS

Content preview

CSCI 215 EXAM 2 UPDATED ACTUAL QUESTIONS AND
CORRECT ANSWERS

Question:
1. The evt.pageY property returns the vertical coordinate (in pixels) of the mouse pointer relative to the
document. True or False
Answer:
True

Question:
2. The evt.target returns the object in which the event was initiated. True or False
Answer:
True

Question:
3. Good coding practice dictates that global variables must be used as much as possible in a program. True
or False
Answer:
False

Question:
4. Identify the correct syntax to prevent a submit button from submitting a web form when clicked using
the prevent default() method.
Answer:
document.querySelector("input[type='submit']").onclick = runForm; function runForm(e) {
e.preventDefault(); }

Question:
5. Named functions are more concise and easier to manage than anonymous functions. True or False
Answer:
False

Question:
6. Identify the mouse event property that returns an integer indicating the mouse button that was pressed,
where 0 = none, 1 = left, 2 = wheel or middle, and 3 = right.
Answer:
evt.which

Question:
7. During a mouse action, events cannot be fired more than once. True or False
Answer:
False

, Question:
8. _________ are actions initiated by a user or a browser, such as clicking on an object on a form or
closing a webpage.
Answer:
Events

Question:
9. Which of the following syntaxes displays a dialog box, causing the user to enter input text?
alert(text[,defaultInput]) confirm(text[,defaultInput]) prompt(text[,defaultInput]) print(text[,defaultInput])
Answer:
prompt(text[,defaultInput])

Question:
10. Which of the following is the correct syntax for a command in JavaScript to apply inline styles using
the following style attribute?
<element style = "property:value">...
Answer:
object.style.property = "value";

Question:
11. Identify a true statement about a function in JavaScript.
A function can be stored as a variable.
An object is passed through a function using the pass by value method.
A special function exists for multithreading in JavaScript.
An object is passed through a function using pass by reference method.
Answer:
A function can be stored as a variable.

Question:
12. Which of the following JavaScript expressions is equivalent to the given HTML code? <div
id="menu1" class="menu">
Answer:
document.getElement- ById("menu1").class- Name = "menu";

Question:
13. Identify the syntax to add an event listener to an object.
Answer:
object.addEventListener(event, function [, capture = false]);

Question:
14. In the following code, identify the value of children.length property if article is the element node.
<article> <h1>The U.S. Constitution</h1> <h2>Preamble</h2> <p>We the People of the United States, in
Order to form a more perfect Union ... </p> </article>
Answer:
3

Document information

Uploaded on
September 12, 2026
Number of pages
7
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$13.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
STANFORDGENIUS
4.0
(235)
Sold
1557
Followers
108
Items
113226
Last sold
3 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions