Moving Elements within the DOM Tree

Form a word by clicking the letter tiles.

This app shows how to programmatically move an element on the page.

To move an element on the page, change its parent element. An element can have only one parent, so changing the parent moves the element in the DOM tree. In this example, when you click on a tile, the click handler changes the tile’s parent.

Read this tutorial for more detail, or read the source.

See all samples.