I am using a comment box and insert the value to mysql using ajax. Same time I append the entered comment with jQuery to the same page. The problem is if the entered text is some JavaScript code, like
<script>alert('hello');</script>
it shows the alert. In my database I sanitize these code but since I append it in client side I need to display the entered text like it is.
Well I use,
<div contenteditable="true"></div>
Any immediate help, please?