Skip to main content

Bug Tracker

Side navigation

#4921 closed bug (invalid)

Opened July 19, 2009 01:22AM UTC

Closed July 21, 2009 02:10AM UTC

basic filters (lt & gt) only accept numbers, not variables

Reported by: th507 Owned by: john
Priority: minor Milestone:
Component: selector Version: 1.3.2
Keywords: lt gt filters Cc:
Blocked by: Blocking:
Description

This does not work

var t = 10;

$("div:lt(t)").each();

=

while the following works

$("div:lt(10)").each();

Attachments (0)
Change History (1)

Changed July 21, 2009 02:10AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Selectors do not do automagic variable substitution. This works fine though:

var t = 10;
$("div:lt("+t+")").each();

Please use the forums rather than the bug tracker to ask these kind of questions.