html()
Get the html content of the first matching element. This function cannot be used with XML documents. But it can be used for XHTML documents.
Get the html contents of the first matched element. This property is not available on XML documents (although it will work for XHTML documents).
Return value
String
Example
HTML code:
< p>Hello
jQuery code:
$("div").html();
Result:
Hello
html(val)
Set the html content of each matching element. This function cannot be used with XML documents. But it can be used for XHTML documents.
Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).
Return value
jQuery
Parameters
val (String): Value used to set HTML content
Example
HTML code:
jQuery code:
$("div").html("
Hello Again
Result:
[
]
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn