How do the lt and gt selectors work? Same as order? (if they are both in the same selector)
I need two answers to this question.
1) The result of the next line should NOT ALWAYS be 0 ??? I ask that the td index be greater than 3 AND lower than 2. There is an index that can be: ix> 3 and ix <2 at the same time!
$("tr").find("td:gt(3):lt(2)").length
2) It turns out that when I change the order of the gt and lt selectors, it starts to work well. The result of the following line: 0.
$("tr").find("td:lt(2):gt(3)").length
Is the order of the selectors really independent of the result?
It looks like selector lt doesn't work if it's after gt or something like that!
Additional Information:
- You can watch it here: http://jsfiddle.net/YQtRh/
- For those who are wondering what is the result of the first line of js, is 1.
- , td, , (.text() == 4)
!