<div id="msg_container">
<span> Is this helpful ? </span>
<span class="feedback">
<a title="like"> Yes </a>
<a title="dislike"> No </a>
</span>
</div>
// jQuery Script
$('.feedback a').live('click', function() {
var reference = $(this).parent().parent();
$.post("URL", $("FORM").serialize(),
function(data){
// posted successfully and following will be executed
reference.empty();
reference.add('<span> You have given feedback </span>');
}, "json");
});
The process would be:
The problem:
Any idea how to solve this? I can accept alternative solutions as long as my requirement is fulfilled.
You could use append()
reference.append('<span> You have given feedback </span>');