Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#8785 closed bug (worksforme)

Jquery select id don't work in firefox 4

Reported by: [email protected] Owned by:
Priority: undecided Milestone: 1.next
Component: selector Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:


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 (2)

comment:1 Changed 12 years ago by addyosmani

Resolution: worksforme
Status: newclosed

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/

Last edited 12 years ago by addyosmani (previous) (diff)

comment:2 Changed 12 years ago by Rick Waldron

Component: unfiledselector
Note: See TracTickets for help on using tickets.