Modify ↓
Ticket #8785 (closed bug: worksforme)
Jquery select id don't work in firefox 4
| Reported by: | alexzat@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | selector | Version: | 1.5.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi I'm selecting all id's names that starts with "ct" and ends with divDropDown. This is the whole id name: "ctl00_mainContent_ReportViewer2_ctl04_ctl07_divDropDown"
That's how I find my ID: <script type="text/jscript">$("[id=ct]").filter("[id$=divDropDown]").css("color", "black");</script>
It work in IE,Chrome, Safari but not on firefox 4, (didn't test it on firefox 3) Thanks
Change History
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.

The reason your code wasn't working is because the selector you're attempting to query with is searching for an ID equal to 'ct' rather than an id beginning with 'ct'. What you want to be doing instead is using http://api.jquery.com/attribute-starts-with-selector/ to query for this collection. I've put you together a live demo of this working which functions fine in both Chrome latest and Firefox 4. http://jsfiddle.net/addyosmani/YRGW6/