Modify ↓
Ticket #5868 (closed bug: invalid)
: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: | |
| Blocking: | Blocked by: |
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
Change History
Changed 3 years ago by gloddy
-
attachment
contains_fail_test.htm
added
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

test case for contains failure