jQuery - Update css after JSON append jQuery - Update css after JSON append json json

jQuery - Update css after JSON append


Is the problem with adding a function to content that has been dynamically added? If so, then you would want to use .on() and have it look like so:

$("body").on("mouseenter", "span.post-name" function(event) {   ("span.post-name").css("color", "red");});


$("span.post-name").live('mouseover',function () {    $(this).css("color","red");});

You need to use .live as the new html is inserted on the fly.