Edit this page

up.element up.element.createFromHTML()
JavaScript function

Creates an element from the given HTML fragment.

Use up.hello() to activate JavaScript behavior within the created element.

Example

element = up.element.createFromHTML('<div class="foo"><span>text</span></div>')
element.className // returns 'foo'
element.children[0] // returns <span> element
element.children[0].textContent // returns 'text'
This website uses cookies to improve usability and analyze traffic.
I accept or learn more