Skip to main content

Bug Tracker

Side navigation

#5868 closed bug (invalid)

Opened January 19, 2010 05:16PM UTC

Closed June 14, 2010 12:18AM UTC

:contains() Selector fails to find match when string is passed as a variable

Reported by: gloddy Owned by:
Priority: major Milestone: 1.4.1
Component: unfiled Version: 1.4
Keywords: contains Cc:
Blocked by: Blocking:
Description

Passing :contains a direct string works:

$('ul li:contains("One")').fadeOut();

But passing that same string as a variable fails:

value_in_variable = "Two";

$('ul li:contains(value_in_variable)').fadeOut();

I've attached a standalone html example file.

Attachments (1)
  • contains_fail_test.htm (0.7 KB) - added by gloddy January 19, 2010 05:17PM UTC.

    test case for contains failure

Change History (2)

Changed April 15, 2010 02:40PM UTC by gloddy comment:1

This bug can be deleted. I revisited the issue and found it was a syntax mistake. My apologies.

Changed June 14, 2010 12:18AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed