Set text content for all p elements:
The text() method sets or returns the text content of the selected elements.
When this method is used to return a value, it returns the combined text content of all matched element (HTML markup will be removed).
When this method is used to set a value, it overwrites all content of the selected elements.
| Parameter | Description |
|---|---|
| content | Specifies the new text content for the selected elements. Note: Special characters will be encoded |
Using a function to set the text content of all selected elements.
| Parameter | Description |
|---|---|
| function(index,oldcontent) | Specifies a function that returns the new text content for the
selected elements.
|
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|