Selectors to jQuery:
available in the document and all elements ; function similar to jQuery, and are well supported by more modern browsers. In IE, so it is , they are available from version 8.
The parameter string must contain one or more comma-separated CSS selectors, although in my most complex selector experiments (with pseudo-selectors) have failed.
// captura apenas a PRIMEIRA tag <a> da página:
var a = document.querySelector("a"); // retorna apenas o elemento encontrado (ou null)
// captura, dentro de 'a', TODOS (All) os elementos com classe "classeA" ou "classeB":
var b = a.querySelectorAll(".classeA, .classeB"); // retorna um array de filhos
Array of child elements
They are available in all elements that contain children; contains all child elements (other than pure-text nodes).
var c = b.children[0]; // exemplo de uso
Array of nodes (text / element) children
They are available in all elements, and contain all child elements (textual or not).
var d = c.childNodes[1]; // exemplo de uso