Is there a built-in jQuery function to encode a string as HTML?
I am trying to take the text that the user enters into a text box, and then puts that text in another area of the page. My plan was to take .val()from a text field and pass it to an element .html()element <div>. Perhaps there is a good jQuery plugin to help with this (if it's not built-in) or a better way to achieve this.
For example, if a user places <Victory!>in a text box, I would like the other part of the page to actually display text <Victory!>, and not anything visible.
source
share