jQuery text() method example

In this post,  we are going to see jQuery text method example.

text method is used to get text of all matched elements and text(‘new text’) is used to set text for all matched elements.
Syntax for text() :
Syntax for text(‘new text’) :
Let’s understand with the help of example:

Live demo: Jquery text method example on jsbin.com

Add Comment