I have this line of code with jquery, and I have been told that this line is vulnerable to xss, because I didn't escape the raw data before inject it using html() function.
Please let me know how to escape the data to make it more secure. (I can use javascript instead if that would solve the problem ie. get element by id etc.)
var data= "Some data from user or elsewhere";
$("output_area").html(data);