Reputation: 15
How to escape textbox contents of form using javascript(not jsp page) to avoid xss.It must be redered properly on page while submitting form.
Upvotes: 0
Views: 190
Reputation: 1056
"Insert the text into the document using document.appendChild, document.createTextNode and friends instead of a property (such as innerHTML) that accepts raw HTML."
as Quentin says, or, using an existing textbox, use the value
property:
textObject.value="value"
Upvotes: 1
Reputation: 944216
Insert the text into the document using document.appendChild
, document.createTextNode
and friends instead of a property (such as innerHTML
) that accepts raw HTML.
Upvotes: 2