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

Notice any errors or typos? Please let us know. Please feel free to edit src/dom/dom.js and open a pull request!

관련 레퍼런스