I have a text area. I can set its text with
$("#mytextarea").text("foo")
I can add to the text area like this:
$("#mytextarea").prepend("foo")
But I can not add jquery text () object as follows:
$("#mytextarea").text().prepend("foo")
The reason I want to do this is because if my user forces me to add this text:
$("#mytextarea").prepend("<script>alert('lol i haxed uuu!')</script>")
... the script is executed and I am losing.
reference
source
share