siblings.js 218 B

1234567891011121314151617
  1. define( function() {
  2. "use strict";
  3. return function( n, elem ) {
  4. var matched = [];
  5. for ( ; n; n = n.nextSibling ) {
  6. if ( n.nodeType === 1 && n !== elem ) {
  7. matched.push( n );
  8. }
  9. }
  10. return matched;
  11. };
  12. } );