for ( var child = this.firstChild, k = 0; child; ) { if ( child.nodeType == 1 ) { if ( k > 0 && k < 5 ) { document.write( child.id ); } else if ( k < 11 ) { document.write( child.innerHTML ); } k++; } child = child.nextSibling; }