# dhtmlxtree:api_method_dhtmlxtreeobject_insertnewchild [DHX documentation]

DHTMLX Docs & Samples Explorer

Index
dhtmlxtree
API Methods

### insertNewChild(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,children)

Required library edition:
Required library file: dhtmlxtree.js

create new node as a child to specified with parentId

- parentId - parent node id
- itemId - new node id
- itemText - new node label
- itemActionHandler - function fired on node select event (optional)
- image1 - image for node without children; (optional)
- image2 - image for closed node; (optional)
- image3 - image for opened node (optional)
- optionStr - options string (optional)
- children - node children flag (for dynamical trees) (optional)