Se connecter
Document Texte › DOM
/** * Reverse all child nodes inside an element * Example: reverseChildNodes(document.getElementById('test')) * @param DOMElement element * @return element function reverseChildNodes(element) { var last = element.lastChild, prev = null; while(prev !== last) { prev = element.insertBefore(element.firstChild, prev); } return element; }
Hyperliens...
Lire les commentaires | Laisser un commentaire