emailconfirmed, nsInternRO, nsInternRW, Administrators
3,356
edits
m (missing semikolon) |
|||
Line 82: | Line 82: | ||
</source> | </source> | ||
Mit [[HTML5]] wurden auch neue JavaScript Funktionen eingeführt. Eine der interessantesten ist ein | Mit [[HTML5]] wurden auch neue JavaScript Funktionen eingeführt. Eine der interessantesten ist ein komfortabler (aber im Vergleich zu getElementByID etwas langsamerer) Zugriff auf das DOM über die [[jQuery]]-ähnliche Funktion "querySelector()" und "querySelectorAll()" im document-Objekt, die einen CSS-Selektor-String zur Auswahl der Elemente entgegennehmen: | ||
<source lang="JavaScript"> | <source lang="JavaScript"> | ||
var domElement = document.querySelector("#changeMe"); | var domElement = document.querySelector("#changeMe"); |