Editing JavaScript 1 Document Objekt
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 28: | Line 28: | ||
/* | /* | ||
document.body => greift auf die Elemente im Body zu | document.body => greift auf die Elemente im Body zu | ||
firstElementChild => bezieht sich immer auf das erste Kind-Element (h1) | firstElementChild => bezieht sich immer auf das erste Kind-Element (h1) | ||
nextElementSibling => bezeichnet das nachfolgende Geschwister-Element (h2) | nextElementSibling => bezeichnet das nachfolgende Geschwister-Element (h2) | ||
innerHTML => greift auf Inhalt des angesprochenen Tags zu (Überschrift 2) | innerHTML => greift auf Inhalt des angesprochenen Tags zu (Überschrift 2) | ||
Beispiel um das <i>-Tag anzusprechen: | Beispiel um das <i>-Tag anzusprechen: | ||
document.body.firstElementChild.nextElementSibling.nextElementSibling.firstElementChild | document.body.firstElementChild.nextElementSibling.nextElementSibling.firstElementChild | ||
*/ | */ |