events - adding class to an element via jQuery .live or .delegate -
hi everyone: i'm trying add class via jquery .live ajaxed element using .load mouse action depending events cant find right solution. ideas? in advance.
.live() , .delegate() can't used run arbitrary code when new element added.
they're meant handling events.
if want modify elements, need select them dom, or use direct reference new elements before add them dom.
$.ajax({ url: '/some/path/', datatype: 'html', success: function( d ) { var els = $( d ); els.find('div').addclass('newclass'); els.appendto('body'); } });
Comments
Post a Comment