Modify ↓
Ticket #8486 (closed bug: invalid)
find not working on a select in 1.5.1
| Reported by: | Jason Stone <jstoneie@…> | Owned by: | |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.next |
| Component: | selector | Version: | 1.5.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi,
I have this piece of code -
x = $('#country_select').find('option[text=Ireland]');
which finds the option for Ireland in the select with id 'country_select'.
It works in v1.3 and in 1.4.1, however does not work in 1.5.1
Cheers Jason
Change History
comment:1 Changed 2 years ago by rwaldron
- Keywords needsreview added
- Priority changed from undecided to blocker
- Status changed from new to open
- Component changed from unfiled to selector
comment:2 Changed 2 years ago by timmywil
We have :contains for this. Is it valid to check text as an attribute?
comment:3 Changed 2 years ago by dmethvin
- Keywords needsreview removed
- Status changed from open to closed
- Resolution set to invalid
This is another property-vs-attribute conflict. The new behavior is correct and consistent, since there is no text *attribute* on the option element. Use the :contains() pseudo.
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.

Confirmed
1.4.2: http://jsfiddle.net/rwaldron/pjLKs/2/ 1.5.1: http://jsfiddle.net/rwaldron/pjLKs/1/
I added quotes to the attr value to make sure it was in compliance with the selector requirement.