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

Returns

String: the inner HTML of the element
Notice any errors or typos? Please let us know. Please feel free to edit src/dom/dom.js and open a pull request!

संबंधित संदर्भ