Skip to content

parentsUntil does not work if parent id is used and includes "#" #760

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
DrifterAtSea opened this issue Jul 5, 2017 · 5 comments
Closed

Comments

@DrifterAtSea
Copy link

DrifterAtSea commented Jul 5, 2017

The code example shows the following:

$( "span.subchild" ).parentsUntil( "div.grandparent" );

If the grandparent's id is used instead, you cannot use "#". Example:

$( "span.subchild" ).parentsUntil( "#grandpa");

But it will find it if you leave out the "#":

$( "span.subchild" ).parentsUntil( "grandpa");

This is inconsistent with the way selecting elements by id works with jQuery. Either fix this or indicate this issue in the documentation.

@dmethvin
Copy link
Member

dmethvin commented Jul 5, 2017

The code example

Can you provide a link to the page you are referring to that is here on learn.jquery.com?

@DrifterAtSea
Copy link
Author

@dmethvin
Copy link
Member

dmethvin commented Jul 6, 2017

There isn't an ID on that element so I'm not sure what you're doing. Do the examples as shown work for you? If not it's something we would handle here in this repo and I can reopen the ticket. If it's something else, you should first ensure there is a problem by having others look at it in a place like StackOverflow. If it is confirmed to be some kind of bug you can report it to https://github.com/jquery/jquery/. You'll need to include an example on a site like jsbin.com or jsfiddle.net demonstrating the problem.

@dmethvin dmethvin closed this as completed Jul 6, 2017
@DrifterAtSea
Copy link
Author

You misunderstood. Try an example WITH an id instead of using a class name. parentsUntil will not find a parent if you specify an id instead of a class name.

@dmethvin
Copy link
Member

dmethvin commented Jul 6, 2017

Do you mean you have an example like that not on the learn.jquery.com site? Can you link to it?

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

2 participants