Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13038 closed feature (duplicate)

extend .end()

Reported by: tf@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:

Description

Hi there,

i was using the .end() function for the first time and noticed, that it only traverses one step back in traversal for example:

$(this)
  .find('div')
    .attr('bar', 'foo')
      .find('ul')
        .attr('foo', 'bar')
  .end()
    .log('i am a div')
.end()
  .log('i am $(this)')

so, if i like to get back to $(this) i have to write

.end().end()

...

wouldnt it be nice to have a integer parameter for it :

.end(2)

so the .end() function knows, how many steps it should go up?

or to make some default strings like .end('first') so the .end() function knows, that the very first query is wanted?

what do you think?

Change History (1)

comment:1 Changed 7 years ago by scottgonzalez

Resolution: duplicate
Status: newclosed

Duplicate of #6457.

Note: See TracTickets for help on using tickets.