codeGK
Code it ALL
jQuery set text() - CodeGK

♦ jQuery set text()

♣ Example2: jQuery set text()

Sets the Textual content of selected HTML element, i.e, the input will only be having text and the tags are not supposed to be there.
Basic Syntax
$(selector).text("text_data");
selector: the HTML element to be selected
text(): syntax for assigning text without html tags.
text_data: textual content, excluding HTML tags.
In this example, jQuery set text() method is illustrated.
Example
Input:
Output: