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

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -