Modify ↓
Ticket #10400 (closed feature: invalid)
Leveraging the powers of .live()
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | misc | Version: | 1.6.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
If we already have such a great feature as .live() it would be awesome if one could call .live() with a function as the only paramater. e.g.
$('.greenDivs').live(function() {
$(this).css('color','green');
});
This would make all .greenDivs elements green, existing and newly added ones. It's like the livequery plugin does. I think this feature would be useful enough to add it to the main library.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

live is awful.
The behaviour you describe is actually _exactly_ how CSS works already.