Opened 14 years ago
Closed 14 years ago
#3979 closed bug (worksforme)
jQuery('.class') returns only one element
Reported by: | enerta | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.3.2 |
Component: | unfiled | Version: | 1.3.1 |
Keywords: | select element by class, $('.class') | Cc: | |
Blocked by: | Blocking: |
Description
v 1.3.1 seems to find the first element of a certain class only.
E.g. $('.edit').click(function(){alert('I am .edit. My title is ' + $(this).attr('title'))});
would work on the first of three images but not the rest of them in this case:
<ul> <li><img src="image.gif" title="1" class="edit" /></li> <li><img src="image.gif" title="2" class="edit" /></li> <li><img src="image.gif" title="3" class="edit" /></li> </ul>
Change History (4)
comment:1 Changed 14 years ago by
comment:4 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
This works for me:
http://jquery.nodnod.net/cases/48