参考 html()

html()

Sets the inner HTML of the element, replacing any existing HTML.

The second parameter, append, is optional. If true is passed, as in myElement.html('hi', true), the HTML is appended instead of replacing existing HTML.

If no arguments are passed, as in myElement.html(), the element's inner HTML is returned.

示例

语法

html()
html([html], [append])

参数

html
String: the HTML to be placed inside the element
append
Boolean: whether to append HTML to existing

返回值

String: the inner HTML of the element

相关参考