There are preferences for people to use when and why to use html and/or text method but I would like to inform you the html() method is faster than text() method:
html method is only a wrap to innerHTML, but with text method jQuery add an “entity filter”, and this filter expand time.
- .text() can be used in both XML and HTML documents.
- .html() is only for html documents.
See more info here
So, which one you want to use?
1
solved html() method versus text() method [closed]