Usage of jquery html() method: 1. [html()] method sets or returns the content of the selected element; 2. When this method is used to return content, it returns the content of the first matching element. Content; 3. When this method is used to set content, the content of all matching elements is rewritten.
##Usage of jquery html() method:
Definition and usageSyntax
Return content:$(selector).html()
$(selector).html(content)
$(selector).html(function(index,currentcontent))
Change the content of all
elements:
$("button").click(function(){ $("p").html("Hello <b>world</b>!"); });
JavaScript
The above is the detailed content of How to use jquery html() method. For more information, please follow other related articles on the PHP Chinese website!