Side navigation
#8785 closed bug (worksforme)
Opened April 06, 2011 08:33AM UTC
Closed April 06, 2011 01:42PM UTC
Last modified March 14, 2012 04:45PM UTC
Jquery select id don't work in firefox 4
Reported by: | alexzat@gmail.com | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | selector | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
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
Attachments (0)
Change History (2)
Changed April 06, 2011 01:42PM UTC by comment:1
_comment0: | 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 ^= 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. → 1302097336182964 |
---|---|
_comment1: | 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 ^= 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/ → 1302098951966183 |
resolution: | → worksforme |
status: | new → closed |
Changed April 06, 2011 05:17PM UTC by comment:2
component: | unfiled → selector |
---|
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/