Bug Tracker

Modify

Ticket #8785 (closed bug: worksforme)

Opened 2 years ago

Last modified 14 months ago

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

comment:1 Changed 2 years ago by addyosmani

  • Status changed from new to closed
  • Resolution set to worksforme

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 2 years ago by addyosmani (previous) (diff)

comment:2 Changed 2 years ago by rwaldron

  • Component changed from unfiled to selector

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.