I have a textarea. On its click event. I am inserting it in DB and then displaying it as first element in element list. The problem is. If I enter "<afasd>"
in textarea, jquery does not display it properly. it displays it empty.
The Code is
var note = $.trim( $('#rep_notes_add_notes').val());
if(note == "")
return false;
$.ajax({
url: 'include/tre.ajax.php',
type: 'POST',
data: {
action: 'insert',
note: note
},
dataType: 'json',
success: function(data) {
jQuery("#rep_notes_add_notes").val('');
jQuery(".no_notes").remove();
*$(".notes:eq(0)").before('<div class="notes">'+note+'<div class="note-added"> Added by '+user +'<span> on </span>'+data.update_time+'</div></div>');*
}
});
The line marked as * finds notes div and then insert one element before it to display new entered text.
Could some one help me to resolve this?