HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
jQuery HTML/CSS Methods : Change the content of all <p> elements
The html() method sets or returns the content (innerHTML) of the selected elements.
When this method is used to return content, it returns the content of the FIRST matched element.
When this method is used to set content, it overwrites the content of ALL matched elements.
Return content:
Set content:
Set content using a function:
Parameter | Description |
---|---|
content | Required. Specifies the new content for the selected elements (can contain HTML tags) |
function(index,currentcontent) | Optional. Specifies a function that returns the new content for the selected elements
|