Main

Editor - getHTML() & getText() & getInnerText() #short

Return User's Input

WebSquare

1 month ago

You can return the user's input in the Editor. Use three methods. getHTML(), getText(), and getInnerText(). Let us check each method and what it returns. We are going to enter text in the Editor and execute getHTML(). Let us enter text with line changing. The click the Trigger. Both the text and the HTML tags for line changing are returned. This time, let us execute getText(). Enter the same text and click the Trigger. You can see only text without line changing is returned. Lastly, let us execu
te getInnerText(). Enter the same text in the Editor and click the Trigger. You can see that the text with line changing applied is returned.

Comments