Skip to content

tutorial has incorrect end() selection after reset. #767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sticker592 opened this issue Nov 17, 2017 · 1 comment
Closed

tutorial has incorrect end() selection after reset. #767

sticker592 opened this issue Nov 17, 2017 · 1 comment

Comments

@sticker592
Copy link

The example code on http://learn.jquery.com/using-jquery-core/working-with-selections/ states that end() resets the selection back to the elements returned by find, however the api and browser console show that it resets the selection back to the content id selection returned by $("#content")
$( "#content" )
.find( "h3" )
.eq( 2 )
.html( "new text for the third h3!" )
.end() // Restores the selection to all h3s in #content
.eq( 0 )
.html( "new text for the first h3!" );

@sticker592
Copy link
Author

The original code was right after testing it so I'm closing this, but maybe end could be explained a little better so it makes sense to newbie's like me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant