This commit is contained in:
Philippe Torrel
2026-07-14 14:36:35 +02:00
parent 960451ae4a
commit 3631edde78
39 changed files with 2399 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
@@ -98,11 +98,28 @@
// Übung 5: 010010000100111101010100 — Teil 4
// Wenden Sie sich nochmal der 010010000100111101010100-Tasse zu. Benutzen Sie geeignete Selektoren, um
// 1. alle Bilder zu finden, deren Dateiname auf jpg endet.
const jpgImgEls = Array.from(document.querySelectorAll("img[src$='.jpg'], img[src$='.jpeg']"));
console.log(jpgImgEls);
// 2. alle input-Elemente vom Typ button zu finden, die sich innerhalb von Formularen befinden.
const inpuButtonFormEls = Array.from(document.querySelectorAll('form input[type="button"]'));
console.log(inpuButtonFormEls);
// 3. alle Elemente mit der Klasse model zu finden, die ein Attribut data-model haben, das den Wert V7 enthält.
const dataModelEls = Array.from(document.querySelectorAll('.model[data-model*="V7"]'));
console.log(dataModelEls);
// 4. alle Bilder zu finden, die nicht die Klasse float_left enthalten.
const imgNoFloatLeftEls = Array.from(document.querySelectorAll('img:not(.float_left)'));
console.log(imgNoFloatLeftEls);
// 5. alle zweiten Listenpunkte zu finden.
const allSecondLiEls = Array.from(document.querySelectorAll('li:nth-child(2n)'));
console.log(Array.from(allSecondLiEls));
// 6. alle Listen (ul) zu finden, die unmittelbar nach "einer Überschrift zweiter Ordnung" (h2) folgen.
const ulH2Els = Array.from(document.querySelectorAll('h2 + ul'));
console.log(ulH2Els);
})();
</script>
</body>