JavaScritp.getElementByID

Quiz
•
Computers
•
Professional Development
•
Medium
Coachs Desarrollo
Used 3+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuál es el propósito principal de getElementById en JavaScript?
Obtener el primer elemento de un array.
Acceder a un elemento del DOM mediante su ID.
Crear un nuevo elemento en el DOM.
No vuelve nada del DOM
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuál es el tipo de dato que devuelve getElementById?
Un string
Un número
Un elemento del DOM
Booleano
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Qué sucede si no existe ningún elemento con el ID proporcionado en el documento?
Devuelve un error.
Retorna null.
Se elimina el elemento
Retorna un array vacío
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuál es la sintaxis correcta para utilizar getElementById?
getElementById('elemento').
getElementById[elemento].
getElementById.elemento.
document('elemento')
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuál es la forma más común de utilizar getElementById en un script de JavaScript?
Asignar el resultado a una variable.
Imprimir directamente el resultado en la consola.
Utilizarlo dentro de una función de flecha.
Para llamar una funcion
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Puede un documento tener múltiples elementos con el mismo ID?
Sí, pero es una mala práctica
No, el ID debe ser único en el documento.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Qué método se puede utilizar para cambiar el contenido de un elemento seleccionado con getElementById?
`setContent()`
`innerText`
``innerHTML
innerHTML
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuál es la ventaja de utilizar getElementById en lugar de seleccionar un elemento por su clase?
Es más eficiente en términos de rendimiento
Permite seleccionar múltiples elementos a la vez
No hay ninguna ventaja, ambos métodos son igualmente útiles
Ayuda a seleccionar el último elemento que encuentre
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
¿Cuál es la forma correcta de acceder al atributo “href” de un elemento con ID “enlace” utilizando getElementById?
`document.getElement('enlace').href`
``document.getElementById('enlace').getAttribute('href')
"document.getElementById('enlace').href"
"document.getElementById('enlace').href
Similar Resources on Wayground
12 questions
Python Collections Quiz

Quiz
•
Professional Development
10 questions
Pemamfaatan Akun belajar id

Quiz
•
Professional Development
10 questions
Very Hard HTML Quiz

Quiz
•
Professional Development
10 questions
Seguridad informática 2021

Quiz
•
Professional Development
10 questions
ITN-Direccionamiento IPv6

Quiz
•
Professional Development
10 questions
ILT #1 Web Basic

Quiz
•
Professional Development
10 questions
Roblox

Quiz
•
Professional Development
10 questions
SASS, CSS Animation, RWD

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
15 questions
Fun Random Trivia

Quiz
•
Professional Development
22 questions
Anne Bradstreet 1612-1672

Quiz
•
Professional Development
18 questions
Spanish Speaking Countries and Capitals

Quiz
•
KG - Professional Dev...
14 questions
Fall Trivia

Quiz
•
11th Grade - Professi...
15 questions
Disney Characters Quiz

Quiz
•
Professional Development
15 questions
Quiz to Highlight Q types & other great features in Wayground

Quiz
•
Professional Development