¡GoConqr estrena diseño! Cuéntanos qué te parece.

Módulo 3 de 21 · Multimedia

Selecting Elements

Kostas Diakogiannis

Selecting Elements

Selecting DOM elements

Generally speaking there are many different ways to select elements from an HTML document. We use these functions:

document.body  // returns the whole body element of the html document

document.getElementById('unique') // returns the element with the id set to 'unique'

document.getElementsByTagName('H3') // returns an array with all h3 elements

document.getElementsByClassName('bigSize')  // returns an array with this class elements

document.querySelector('p.intro') // CSS selector type. Returns the first element that is a p and has a class 'intro'

document.querySelectorAll('div img') // returns an array with images that lie inside a div

 

Find a full list here!

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?