GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 3 von 21 · Medien

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!

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck