src/aria/utils/Dom.js
function (parentNode, index, reverse) {
            if (!parentNode) {
                return null;
            }
            var childNodes = parentNode.childNodes, count = 0, l = childNodes.length;
            for (var i = (reverse) ? l - 1 : 0; (reverse) ? i >= 0 : i < l; (reverse) ? i-- : i++) {
                if (childNodes[i].nodeType == 1) {
                    // this is an element
                    if (count == index) {
                        return childNodes[i];
                    }
                    count++;
                }
            }
            return null;
        }
function (parentNode, index, reverse) {
            if (!parentNode) {
                return null;
            }
            var childNodes = parentNode.childNodes, count = 0, l = childNodes.length;
            for (var i = (reverse) ? l - 1 : 0; (reverse) ? i >= 0 : i < l; (reverse) ? i-- : i++) {
                if (childNodes[i].nodeType == 1) {
                    // this is an element
                    if (count == index) {
                        return childNodes[i];
                    }
                    count++;
                }
            }
            return null;
        }
function ( parentNode , index , reverse ) { if ( ! parentNode ) { return null ; } var childNodes = parentNode . childNodes , count = 0 , l = childNodes . length ; for ( var i = ( reverse ) ? l - 1 : 0 ; ( reverse ) ? i >= 0 : i < l ; ( reverse ) ? i -- : i ++ ) { if ( childNodes [ i ] . nodeType == 1 ) { // this is an element if ( count == index ) { return childNodes [ i ] ; } count ++ ; } } return null ; }
Used to retrieve a node element of type ELEMENT
@param {HTMLElement} parentNode
@param {Integer} index the expected index in the list (0=first)
@param {Boolean} reverse true to start from the last child with reverse order
@return {HTMLElement} the dom elt or null if not found
@public
Used to retrieve a node element of type ELEMENT