Ticket #8548 (closed bug: invalid)
Accesing all img element having "icon_notify_green_enabld_16.png" as src value in the end.
| Reported by: | anonymous | Owned by: | anonymous |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | unfiled | Version: | 1.5.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I want to acces all Img element in a HTML Document having "icon_notify_green_enabld_16.png" value in the last of SRC attribute
Eg : <img id="ctl00_ctl00_MainPageBody_SubMaster_dlstKpiSummaries_ctl04_gvKPIs_ctl03_ThresholdIcon" style="border-right-width: 0px; width: 16px; border-top-width: 0px; border-bottom-width: 0px; height: 16px; border-left-width: 0px;" src="Common/Images/icon_notify_green_enabld_16.png" complete="complete"/>
following code gives me same using Jquery 1.4.1
<div id="greenSign" onclick="showHideColor('img[src$=icon_notify_green_enabld_16.png]','#74B749')">
</div>
function showHideColor(item, color) {
debugger; var imgs = $(item); for (i = 0; i < imgs.length; i++) {
var img = imgs[i]; var td = img.parentNode.nextSibling; if (td != null) {
if (td.style.backgroundColor != ) {
td.style.backgroundColor = ;
} else {
td.style.backgroundColor = color;
}
}
}
But by using Jquery 1.5.1 throwing exception in following line
var imgs = $(item);
Change History
comment:1 Changed 2 years ago by addyosmani
- Owner set to anonymous
- Status changed from new to pending
comment:2 Changed 2 years ago by addyosmani
- Status changed from pending to closed
- Resolution set to invalid
Thanks for submitting a ticket to the jQuery Bug Tracker. We're unfortunately unable to assist with debugging or solving projects without a valid reproduced test case but if you require more assistance here, please feel free to use the jQuery Forums or the #jquery channel on freenode.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for submitting a ticket to the jQuery Bug tracker. Could you kindly submit a reduced test case that reproduces the issue you're experiencing on http://jsFiddle.net?. This will allow us to fully evaluate whether the issue you are experiencing is indeed due to jQuery core or whether it's simply a bug with your code.