So far I have done so: $("*").live("mouseover", function(e) { var le = e.originalTarget; var className = le.getAttribute("class"); if (className == 'someclass') { ....... } }); but I don't think what this is true way. May be somebody knows the correct decision?
On 27 фев, 17:19, gav <aleksey.gor...@gmail.com> wrote: > However, if I try to do the same with .live() to bind events to > dynamically created elements - an event does not work, like specified > an invalid selector. > $(".someclass").live("mouseover", function(e) {...}); - so does not > work, but works well: > $("#someid").live("mouseover", function(e) {...}); > > In this regard, I have 2 questions: > - Such conduct live() was conceived, or it will be fixed later? > - How can I trigger an event without using the id element?