@@Gunnar Bittersmann
Was Du benötigst, sind diese Stichworte:
- wie man mit querySelectorAll alle Elemente findet, die einem (CSS-)Selektor entsprechen
Nein, das benötigt man nicht.
document.links
gibt’s schon. Zitat 2280 auch.
Aber auch das benötigt man nicht, wenn man event delegation einsetzt: click
-Eventhandler für body
, darin prüfen, ob der Auslöser (event.target
) von einem Link stammt.
Was aber auch noch benötigt wird:
- wie man Attributwerte von Elementen ausliest, in dem Fall das
href
-Attribut des betreffenden Links
Ach, und noch was:
😷 LLAP
--
“When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life.” —John Lennon
“When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life.” —John Lennon