• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 6 páginas
Examen

JavaScript Chapter 7 with correct answers 100% 2025

Document preview thumbnail
Vista previa 2 fuera de 6 páginas

JavaScript Chapter 7 with correct answers 100% 2025 Why might you want to preload images on a page that uses rollovers? A. To prevent delays displaying the images when the swapped images are large. B. To prevent delays displaying the images when the connection is slow. C. To prevent delays when the page is being loaded. D. All of the above. E. A and B only. - A and B only. Assuming that the href attribute of each a element contains the URL for an image, what does the code that follows do? const flowers = SelectorAll("a"); for (let flower of flowers) { const image = new Image(); = ;} A. It stores all a elements in an array named flowers. B. It creates a new Image object for each image in the flowers array. C. It preloads each Image object. D. All of the above. E. A and B only. - All of the above. Given this HTML: main h1Image Swap/h1 pClick on an image to enlarge./p ul id="image_list" lia href="images/" title="dogs" img src="thumbnails/" alt=""/a/li lia href="images/" title="cats" img src="thumbnails/" alt=""/a/li /ul h2 id="caption"Animals/h2 pimg id="main_image" src="images/" alt=""/p /main Why are the img elements for the thumbnails coded within the a elements? A. So the user can swap the main image by pressing Enter when a thumbnail has the focus. B. So the user can access the thumbnail links by pressing the Tab key.

Vista previa del contenido

JavaScript Chapter 7 with correct
answers 100% 2025
Why might you want to preload images on a page that uses rollovers?

A. To prevent delays displaying the images when the swapped images are large.
B. To prevent delays displaying the images when the connection is slow.
C. To prevent delays when the page is being loaded.
D. All of the above.
E. A and B only. - A and B only.

Assuming that the href attribute of each <a> element contains the URL for an image,
what does the code that follows do?

const flowers = document.querySelectorAll("a");
for (let flower of flowers) {
const image = new Image();
image.src = flower.href;}

A. It stores all <a> elements in an array named flowers.
B. It creates a new Image object for each image in the flowers array.
C. It preloads each Image object.
D. All of the above.
E. A and B only. - All of the above.

Given this HTML:

<main>
<h1>Image Swap</h1>
<p>Click on an image to enlarge.</p>
<ul id="image_list">
<li><a href="images/pic1.jpg" title="dogs">
<img src="thumbnails/t1.jpg" alt=""></a></li>
<li><a href="images/pic2.jpg" title="cats">
<img src="thumbnails/t2.jpg" alt=""></a></li>
</ul>
<h2 id="caption">Animals</h2>
<p><img id="main_image" src="images/pic1.jpg" alt=""></p>
</main>

Why are the img elements for the thumbnails coded within the <a> elements?

A. So the user can swap the main image by pressing Enter when a thumbnail has the
focus.
B. So the user can access the thumbnail links by pressing the Tab key.

, C. So the application is easy to use by the motor-impaired.
D. All of the above. - All of the above.

Which example line or lines of code attach an event handler for the click event of each
link?

A. document.addEventListener("DOMContentLoaded", () => {
const caption = $("#caption");
const mainImage = $("#main_image");
const imageLinks = $("#image_list").querySelectorAll("a");

B. for (let link of imageLinks) {
const image = new Image();
image.src = link.href;

C. link.addEventListener("click", evt => {
mainImage.src = link.href;
mainImage.alt = link.title;
caption.textContent = link.title;
evt.preventDefault();
});

D. imageLinks[0].focus(); - link.addEventListener("click", evt => {
mainImage.src = link.href;
mainImage.alt = link.title;
caption.textContent = link.title;
evt.preventDefault();
});

const imageLinks = $("#image_list").querySelectorAll("a");

for (let link of imageLinks) {
const image = new Image();
image.src = link.href;

What does the link variable refer to?

A. the image that's currently being processed
B. the <a> element that's currently being processed
C. the <img> element that the user clicked on
D. the <a> element that the user clicked on - the <a> element that's currently being
processed

link.addEventListener("click", evt => {
mainImage.src = link.href;
mainImage.alt = link.title;

Información del documento

Subido en
1 de noviembre de 2025
Número de páginas
6
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$9.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Wairimumburia
3.5
(2)
Vendido
25
Seguidores
3
Artículos
2826
Última venta
1 semana hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes