-
Notifications
You must be signed in to change notification settings - Fork 480
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
Comments
Can you provide a link to the page you are referring to that is here on learn.jquery.com? |
Here's the link: https://learn.jquery.com/using-jquery-core/traversing/ |
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. |
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. |
Do you mean you have an example like that not on the learn.jquery.com site? Can you link to it? |
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.
The text was updated successfully, but these errors were encountered: