Questions tagged [jquery-traversing]

Functions in the Traversing category in the jQuery JavaScript library allow for the selection and manipulation of element(s) based on the function description.

A complete list of supported traversal functions is available at jQuery's API documentation: Traversing. Subcategories of this category are Filtering, Tree Traversal, and Miscellaneous Traversal.

Functions like .children(), .prevAll() and .each() are included in this category.

162 questions
1
vote
2 answers

jQuery(this).find('title').next().next().next().eq(0).text();?

what's the better/elegant way to do this? jQuery(this).find('title').next().next().next().eq(0).text(); //THIS WORKS i tried using jQuery(this).find('title').eq(3) //DOESN't WORK but it doesnt...
Francesco
  • 24,839
  • 29
  • 105
  • 152
1
vote
1 answer

Using prevAll to select all sections of a table containing a keyword

Here's the jsFiddle with the relevant table HTML. I want to use jQuery to highlight or remove sections of a table if they contain certain keywords. …
ky.
  • 53
  • 6
1
vote
1 answer

Traversing down DOM tree for next class; sibling or children

I have a layout scenario where a fixed arrow down is designed to smooth scroll a user to the next full height section. Each section has a class (.section) This works and is fairly straightforward when each section are all siblings. There is one…
1
vote
1 answer

jquery set class for a children of particular type

I have callout label associated with multiple controls, which should turn red when either of it is wrong.
apple
1
jquery will make my class as updnValidationErrorLabel this text is…
user420054
  • 65
  • 4
  • 14
1
vote
0 answers

jQuery nextAll() traversing method equivalent in Nokogiri?

I wrote the following code with jQuery: $("#bar").nextAll(".foo").each(function(index){ console.log($(this)) }) And I'd like to transpose it to Nokogiri. I read the documentation for Nokogiri - jQuery but I cannot find how to write an…
Rowandish
  • 2,655
  • 3
  • 31
  • 52
1
vote
0 answers

Get element id from DOM path

I've seen many times how to get the DOM path of an element using JQuery, but never how to go in the opposite direction: how do I get the element from the DOM path? Suppose I have a DOM path like "html/body/div1/div2/div2/div3/div3/em"; I want to…
tenik
  • 250
  • 1
  • 4
  • 20
1
vote
1 answer

jquery on() function and get value/text using traversing

How can I get value/text using on() function? html w/php from ajax response echo "
"; echo "X".$row["prdct_id"]."
"; …
mon-sun
  • 105
  • 10
1
vote
2 answers

Traversing in jquery through multiple elements

So I am trying to traverse through multiple elements and I seem to be having a problem. I have 2 divs that have two child elements each - an input and a link. Inside the link there is also an image. When I click on the input button of the first div,…
user4909046
1
vote
3 answers

appending element contents with the contents of a descendant elements sibling with jquery

I have the following html...
first section header
1
vote
5 answers

How can I avoid traversing the same DOM route multiple times?

I have an on function that has two mouse events inside of it mouseenter and mouseleave. When these events are triggered they run different functions, one adds a class, the other removes…
1
vote
2 answers

Jquery parent child dom tranversing using a self referencing function

Basically, I'm attempting to recursively read the dom tree backwards to generate a path. The reading of the dom starts with a clicked item and goes up to the parent, collects a attribute value and carries on upward following strict naming…
Brian Dillingham
  • 9,118
  • 3
  • 28
  • 47
1
vote
3 answers

Finding next sibling of parent in Jquery

I've seen this (apparently) exact same problem addressed here, but the solution is simply not working for me. I can't seem to select the element I wish to show / hide. I have the following HTML, repeated for several similar items:
Adam Abrams
  • 107
  • 1
  • 11
1
vote
2 answers

Select the first element of a class 'x' after a link with jQuery

I've got some code like this:

Lorem ipsumlinkTextMore lorem ipsumlinkText 2 And I'd like to let users click the link and be able to do something with…

Heliostatic
  • 175
  • 2
  • 14
1
vote
2 answers

How to clone an element and append to a specific div?

I have a page that has a couple image thumbnails that when clicked on they get cloned and appended into another element. The issue that I'm running in to is that all of the elements that I need to appendTo all have the same class. So if I click one…
Dustin
  • 4,314
  • 12
  • 53
  • 91
1
vote
3 answers

How come selectors in $.fn.find() cannot reference the tree beyond the current $ scope?

In jQuery $('html head').length // 1 And $('html').find('head').length // 1 And $('html').find('head').filter('html head').length // 1 BUT $('html').find('html head').length //…
Barney
  • 16,181
  • 5
  • 62
  • 76